D.3 Hierarchical RCU Code Walkthrough
Keywords: perfbook_html

#
D.3 Hierarchical RCU Code Walkthrough

This section walks through selected sections of the Linux-kernel hierarchical RCU code. As such, this section is intended for hard-core hackers who wish to understand hierarchical RCU at a very low level, and such hackers should first read Section . Hard-core masochists might also be interested in reading this section. Of course really hard-core masochists will read this section before reading Section .

Section describes data structures and kernel parameters, Section covers external function interfaces, Section presents the initialization process, Section explains the CPU-hotplug interface, Section covers miscellaneous utility functions, Section describes the mechanics of grace-period detection, Section presents the dynticks-idle interface, Section covers the functions that handle holdout CPUs (including offline and dynticks-idle CPUs), and Section presents functions that report on stalled CPUs, namely those spinning in kernel mode for many seconds. Finally, Section reports on possible design flaws and fixes.

Subsections

- D.3.1 Data Structures and Kernel Parameters
  - D.3.1.1 Tracking Dyntick State
  - D.3.1.2 Nodes in the Hierarchy
  - D.3.1.3 Per-CPU Data
  - D.3.1.4 RCU Global State
  - D.3.1.5 Kernel Parameters
- D.3.2 External Interfaces
  - D.3.2.1 Read-Side Critical Sections
  - D.3.2.2 `call_rcu()`
  - D.3.2.3 `rcu_check_callbacks()`
  - D.3.2.4 `rcu_process_callbacks()`
  - D.3.2.5 `rcu_needs_cpu()` and `rcu_cpu_notify()`
- D.3.3 Initialization
  - D.3.3.1 `rcu_init_levelspread()`
  - D.3.3.2 `rcu_init_one()`
  - D.3.3.3 `__rcu_init()`
- D.3.4 CPU Hotplug
  - D.3.4.1 `rcu_init_percpu_data()`
  - D.3.4.2 `rcu_online_cpu()`
  - D.3.4.3 `rcu_offline_cpu()`
- D.3.5 Miscellaneous Functions
- D.3.6 Grace-Period-Detection Functions
  - D.3.6.1 Noting New Grace Periods
  - D.3.6.2 Noting End of Old Grace Periods
  - D.3.6.3 Starting a Grace Period
  - D.3.6.4 Reporting Quiescent States
- D.3.7 Dyntick-Idle Functions
  - D.3.7.1 Entering and Exiting Dyntick-Idle Mode
  - D.3.7.2 NMIs from Dyntick-Idle Mode
  - D.3.7.3 Interrupts from Dyntick-Idle Mode
  - D.3.7.4 Checking for Dyntick-Idle Mode
- D.3.8 Forcing Quiescent States
  - D.3.8.1 Recording and Recalling Dynticks-Idle Grace Period
  - D.3.8.2 Handling Offline and Holdout CPUs
  - D.3.8.3 Scanning for Holdout CPUs
  - D.3.8.4 Code for `force_quiescent_state()`
- D.3.9 CPU-Stall Detection
- D.3.10 Possible Flaws and Changes