Avoiding Pipeline Stalls in Hyperthreaded Processors: Iit Bombay M.Tech1
Avoiding Pipeline Stalls in Hyperthreaded Processors: Iit Bombay M.Tech1
Avoiding Pipeline Stalls in Hyperthreaded Processors: Iit Bombay M.Tech1
HYPERTHREADED PROCESSORS
IIT BOMBAY
M.TECH1
Contents
Hyperthreaded processing
Pipeline stalls
NetBurst Architecture
Spin-wait
References
Hyperthreaded Processing
Fig:Pipeline stalls would look different in a 4-stage pipeline with the effect of “Bubbles”
Why avoid pipeline stalls??
top_of_loop:
load x into a register
compare to 0
if not equal,
goto top_of_loop
else
...
Spin wait(2)
It sees that the loop does not depend on any variables being
calculated by other instructions and so the sequence can be
executed without fear of disturbing other instructions.
In addition, it knows that if x changes value while the loop is
running, this change will be caught before the instructions are
retired by the processor. As a result, it grabs this sequence
and executes it numerous times and very quickly.
In the process, it floods the processor's store of instructions
to be retired with the repeated iterations of the loop.
With no reason to slow down, the speculative execution
continues to crank out the instructions at full tilt. Finally, the
variable being waited on changes value.
Spin wait(3)
It is clear that the loop variable cannot change faster than the
memory bus can update it. Hence, there is no benefit to pre-
execute the loop faster than the time needed for a memory
refresh. By inserting a pause instruction into a loop, the
programmer tells the processor to wait for the amount of time
equivalent to this memory access. On processors with Hyper-
Threading Technology, this respite enables the other
thread to use all of the resources on the physical
processor and continue processing.
_asm
{
Pause
}
http://www.drdobbs.com/high-performance-computing
http://en.wikipedia.org/wiki/NetBurst_%
28microarchitecture%29
http://en.wikipedia.org/wiki/Hyper-threading
http://en.wikipedia.org/wiki/Pipeline_stall
Thank You
N.Kedhar Nath
10305058