E.8.1 State Variables for Simplified Dynticks Interface

Figure: Variables for Simple Dynticks Interface
\begin{figure}{ \scriptsize
\begin{verbatim}1 void rcu_nmi_enter(void)
2 {
...
...ATELIMIT(rdtp->dynticks_nmi & 0x1, &rcu_rs);
24 }\end{verbatim}
}\end{figure}

Figure [*] shows the new per-CPU state variables. These variables are grouped into structs to allow multiple independent RCU implementations (e.g., rcu and rcu_bh) to conveniently and efficiently share dynticks state. In what follows, they can be thought of as independent per-CPU variables.

The dynticks_nesting, dynticks, and dynticks_snap variables are for the irq code paths, and the dynticks_nmi and dynticks_nmi_snap variables are for the NMI code paths, although the NMI code path will also reference (but not modify) the dynticks_nesting variable. These variables are used as follows:

If both dynticks and dynticks_nmi have taken on an even value during a given time interval, then the corresponding CPU has passed through a quiescent state during that interval.

Quick Quiz E.19: But what happens if an NMI handler starts running before an irq handler completes, and if that NMI handler continues running until a second irq handler starts? End Quick Quiz

Paul E. McKenney 2011-02-12