speculative-execution

What happens with nested branches and speculative execution?

放肆的年华 提交于 2021-01-24 07:06:25
问题 Alright, so I know that if a particular conditional branch has a condition that takes time to compute (memory access, for instance), the CPU assumes a condition result and speculatively executes along that path. However, what would happen if, along that path, yet another slow conditional branch pops up (assuming, of course, that the first condition hasn't been resolved yet and the CPU can't just commit the changes)? Does the CPU just speculate inside the speculation? What happens if the last

What happens with nested branches and speculative execution?

女生的网名这么多〃 提交于 2021-01-24 06:59:30
问题 Alright, so I know that if a particular conditional branch has a condition that takes time to compute (memory access, for instance), the CPU assumes a condition result and speculatively executes along that path. However, what would happen if, along that path, yet another slow conditional branch pops up (assuming, of course, that the first condition hasn't been resolved yet and the CPU can't just commit the changes)? Does the CPU just speculate inside the speculation? What happens if the last

What happens with nested branches and speculative execution?

假如想象 提交于 2021-01-24 06:59:08
问题 Alright, so I know that if a particular conditional branch has a condition that takes time to compute (memory access, for instance), the CPU assumes a condition result and speculatively executes along that path. However, what would happen if, along that path, yet another slow conditional branch pops up (assuming, of course, that the first condition hasn't been resolved yet and the CPU can't just commit the changes)? Does the CPU just speculate inside the speculation? What happens if the last

Why not just predict both branches?

别等时光非礼了梦想. 提交于 2020-05-25 04:57:05
问题 CPU's use branch prediction to speed up code, but only if the first branch is actually taken. Why not simply take both branches? That is, assume both branches will be hit, cache both sides, and the take the proper one when necessary. The cache does not need to be invalidated. While this requires the compiler to load both branches before hand(more memory, proper layout, etc), I imagine that proper optimization could streamline both so that one can get near optimal results from a single

Has Hardware Lock Elision gone forever due to Spectre Mitigation?

*爱你&永不变心* 提交于 2020-05-07 03:48:57
问题 Is this correct that Hardware Lock Elision is disabled for all current CPUs due to Spectre mitigation, and any attempt to have a mutex using HLE intrinsics/instructions would result in usual mutex? Is this likely that there will not be anything like HLE mutexes in future to avoid vulnerabilities like Spectre? 回答1: So, TSX may be disabled not to mitigate Spectre, but as a part of another vulnerability mitigation, TSX Asynchronous Abort (TAA). Here's relevant article on Intel website: Intel®

Why flush the pipeline for Memory Order Violation caused by other logical processors?

ぐ巨炮叔叔 提交于 2020-02-28 04:02:50
问题 The Memory Order Machine Clear performance event is described by the vTune documentation as: The memory ordering (MO) machine clear happens when a snoop request from another processor matches a source for a data operation in the pipeline. In this situation the pipeline is cleared before the loads and stores in progress are retired. However I don't see why that should be the case. There is no synchronisation order between loads and stores on different logical processors. The processor could

Hadoop Reducer: How can I output to multiple directories using speculative execution?

主宰稳场 提交于 2019-12-31 04:50:08
问题 I have a reducer that needs to output results to different directories so that we can later use the output as input to Hive as a partitioned table. (Hive creates partitions based on folder name). In order to write out to these locations, we are currently not using any Hadoop framework to accomplish this, we are just writing out to separate locations "behind Hadoop's back", so to speak. In other words we are not using hadoop's API to output these files. We had issues with mapred.reduce.tasks

Out-of-order execution vs. speculative execution

雨燕双飞 提交于 2019-12-17 09:49:21
问题 I have read the wikipedia page about out-of-order execution and speculative exectution. What I fail to understant though are the similarities and differences. It seems to me that speculative execution uses out-of-order execution when it has not determined the value of a condition for example. The confusion came when I read the papers of Meltdown and Spectre and did additional research. It is stated in the Meltdown paper that Meltdown is based on out-of-order execution, while some other

Haskell speculative parallel execution

百般思念 提交于 2019-12-09 15:59:08
问题 I am thinking about exploiting parallelism for one problem I am trying to solve. The problem is roughly this: given input (sequence of points) find a best output (biggest triangle composed from these points, longest line etc.). There are 3 different 'shapes' to be found in the sequence of points, however I am interested only in the one with 'best score' (usually some form of 'length' times coefficient). Let's call the shapes S1, S2, S3. I have 2 different algorithms for solving S1 - 'S1a' is