D.4.2.2.2 rcu_data
Keywords: perfbook_html

####
D.4.2.2.2 `rcu_data`

The rcu_data structure is a per-CPU structure, and contains the following fields:

- lock guards the remaining fields in this structure.
- completed is used to synchronize CPU-local activity with the global counter in rcu_ctrlblk.
- waitlistcount is used to maintain a count of the number of non-empty wait-lists. This field is used by rcu_pending() to help determine if this CPU has any RCU-related work left to be done.
- nextlist, nextail, waitlist, waittail, donelist, and donetail form lists containing RCU callbacks that are waiting for invocation at the end of a grace period. Each list has a tail pointer, allowing appends. The RCU callbacks flow through these lists as shown below.
- rcupreempt_trace accumulates statistics.

Figure: Preemptible RCU Callback Flow

Figure shows how RCU callbacks flow through a given rcu_data structure's lists, from creation by call_rcu() through invocation by rcu_process_callbacks(). Each blue arrow represents one pass by the grace-period state machine, which is described in a later section.