10.07.2015 Views

Is Parallel Programming Hard, And, If So, What Can You Do About It?

Is Parallel Programming Hard, And, If So, What Can You Do About It?

Is Parallel Programming Hard, And, If So, What Can You Do About It?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

D.2. HIERARCHICAL RCU OVERVIEW 193struct rcu_statercu_bhrcustructrcu_nodeInitialize GPstructrcu_nodestructrcu_datastructrcu_nodestructrcu_dataAllCPUs PassedThroughQS?NYstructrcu_datastructrcu_dataWait for QSstructrcu_dynticksstructrcu_dynticksCPU PassesThrough QSNstructrcu_dynticksstructrcu_dynticksCPU OfflineGP TooLong?Figure D.17: Hierarchical RCU State With DynticksMark CPU asBeing inExtended QSYmachines as shown in Figure D.18. The commoncasepath through this state machine on a busy systemgoes through the two uppermost loops, initializingat the beginning of each grace period (GP),waiting for quiescent states (QS), and noting wheneach CPU passes through its first quiescent statefor a given grace period. On such a system, quiescentstates will occur on each context switch, or,for CPUs that are either idle or executing usermodecode, each scheduling-clock interrupt. CPUhotplugevents will take the state machine throughthe “CPU Offline” box, while the presence of “holdout”CPUs that fail to pass through quiescent statesquickly enough will exercise the path through the“Send resched IP<strong>Is</strong> to Holdout CPUs” box. RCUimplementations that avoid unnecessarily awakeningdyntick-idle CPUs will mark those CPUs as beingin an extended quiescent state, taking the “Y”branch out of the “CPUs in dyntick-idle Mode?”decision diamond (but note that CPUs in dyntickidlemode will not be sent resched IP<strong>Is</strong>). Finally, ifCONFIG_RCU_CPU_STALL_DETECTOR is enabled, trulyYMark CPUs asBeing inExtended QSComplain <strong>About</strong>Holdout CPUsCPUs indyntick−idleMode?YSend resched IP<strong>It</strong>o RemainingHoldout CPUsGPWay TooLong?Figure D.18: Generic RCU State MachineNN

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!