E.8.2 Entering and Leaving Dynticks-Idle Mode
Keywords: perfbook_html

##
E.8.2 Entering and Leaving Dynticks-Idle Mode

Figure: Entering and Exiting Dynticks-Idle Mode

Figure shows the rcu_enter_nohz() and rcu_exit_nohz(), which enter and exit dynticks-idle mode, also known as ``nohz'' mode. These two functions are invoked from process context.

Line 6 ensures that any prior memory accesses (which might include accesses from RCU read-side critical sections) are seen by other CPUs before those marking entry to dynticks-idle mode. Lines 7 and 12 disable and reenable irqs. Line 8 acquires a pointer to the current CPU's rcu_dynticks structure, and line 9 increments the current CPU's dynticks counter, which should now be even, given that we are entering dynticks-idle mode in process context. Finally, line 10 decrements dynticks_nesting, which should now be zero.

The rcu_exit_nohz() function is quite similar, but increments dynticks_nesting rather than decrementing it and checks for the opposite dynticks polarity.