kernel/rcu/tree_plugin.h
Source file repositories/reference/linux-study-clean/kernel/rcu/tree_plugin.h
File Facts
- System
- Linux kernel
- Corpus path
kernel/rcu/tree_plugin.h- Extension
.h- Size
- 46483 bytes
- Lines
- 1370
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../locking/rtmutex_common.h
Detected Declarations
function rcu_rdp_is_offloadedfunction rcu_bootup_announce_oddnessfunction rcu_bootup_announcefunction rcu_qsfunction rcu_note_context_switchfunction rcu_preempt_blocked_readers_cgpfunction rcu_preempt_read_enterfunction rcu_preempt_read_exitfunction rcu_preempt_depth_setfunction rcu_read_lockfunction rcu_read_unlockfunction rcu_preempt_has_tasksfunction rcu_read_unlock_specialfunction rcu_preempt_need_deferred_qsfunction rcu_preempt_need_deferred_qsfunction rcu_preempt_deferred_qs_handlerfunction rcu_read_unlockfunction rcu_read_unlockfunction rcu_preempt_check_blocked_tasksfunction rcu_flavor_sched_clock_irqfunction debug_check_no_locks_heldfunction dump_blkd_tasksfunction rcu_preempt_deferred_qs_initfunction __rcu_read_unlockfunction rcu_bootup_announcefunction rcu_qsfunction rcu_all_qsfunction rcu_note_context_switchfunction rcu_preempt_blocked_readers_cgpfunction rcu_preempt_has_tasksfunction rcu_preempt_need_deferred_qsfunction rcu_preempt_deferred_qsfunction rcu_preempt_check_blocked_tasksfunction rcu_flavor_sched_clock_irqfunction exit_rcufunction rcu_preempt_deferred_qs_initfunction rcu_is_callbacks_nocb_kthreadfunction rcu_is_callbacks_kthreadfunction rcu_boostfunction rcu_boost_kthreadfunction rcu_initiate_boostfunction IS_ENABLEDfunction rcu_preempt_boost_start_gpfunction rcu_spawn_one_boost_kthreadfunction rcu_initiate_boostfunction rcu_preempt_boost_start_gpfunction rcu_bind_gp_kthreadexport rcu_note_context_switch
Annotated Snippet
if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD)) {
rdp->cpu_no_qs.b.norm = false;
rcu_report_qs_rdp(rdp);
udelay(rcu_unlock_delay);
} else {
rcu_qs();
}
}
/*
* Respond to a request by an expedited grace period for a
* quiescent state from this CPU. Note that requests from
* tasks are handled when removing the task from the
* blocked-tasks list below.
*/
if (rdp->cpu_no_qs.b.exp)
rcu_report_exp_rdp(rdp);
/* Clean up if blocked during RCU read-side critical section. */
if (special.b.blocked) {
/*
* Remove this task from the list it blocked on. The task
* now remains queued on the rcu_node corresponding to the
* CPU it first blocked on, so there is no longer any need
* to loop. Retain a WARN_ON_ONCE() out of sheer paranoia.
*/
rnp = t->rcu_blocked_node;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
WARN_ON_ONCE(rnp != t->rcu_blocked_node);
WARN_ON_ONCE(!rcu_is_leaf_node(rnp));
empty_norm = !rcu_preempt_blocked_readers_cgp(rnp);
WARN_ON_ONCE(rnp->completedqs == rnp->gp_seq &&
(!empty_norm || rnp->qsmask));
empty_exp = sync_rcu_exp_done(rnp);
np = rcu_next_node_entry(t, rnp);
list_del_init(&t->rcu_node_entry);
t->rcu_blocked_node = NULL;
trace_rcu_unlock_preempted_task(TPS("rcu_preempt"),
rnp->gp_seq, t->pid);
if (&t->rcu_node_entry == rnp->gp_tasks)
WRITE_ONCE(rnp->gp_tasks, np);
if (&t->rcu_node_entry == rnp->exp_tasks)
WRITE_ONCE(rnp->exp_tasks, np);
if (IS_ENABLED(CONFIG_RCU_BOOST)) {
/* Snapshot ->boost_mtx ownership w/rnp->lock held. */
drop_boost_mutex = rt_mutex_owner(&rnp->boost_mtx.rtmutex) == t;
if (&t->rcu_node_entry == rnp->boost_tasks)
WRITE_ONCE(rnp->boost_tasks, np);
}
/*
* If this was the last task on the current list, and if
* we aren't waiting on any CPUs, report the quiescent state.
* Note that rcu_report_unblock_qs_rnp() releases rnp->lock,
* so we must take a snapshot of the expedited state.
*/
empty_exp_now = sync_rcu_exp_done(rnp);
if (!empty_norm && !rcu_preempt_blocked_readers_cgp(rnp)) {
trace_rcu_quiescent_state_report(TPS("preempt_rcu"),
rnp->gp_seq,
0, rnp->qsmask,
rnp->level,
rnp->grplo,
rnp->grphi,
!!rnp->gp_tasks);
rcu_report_unblock_qs_rnp(rnp, flags);
} else {
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
}
/*
* If this was the last task on the expedited lists,
* then we need to report up the rcu_node hierarchy.
*/
if (!empty_exp && empty_exp_now)
rcu_report_exp_rnp(rnp, true);
/* Unboost if we were boosted. */
if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex)
rt_mutex_futex_unlock(&rnp->boost_mtx.rtmutex);
} else {
local_irq_restore(flags);
}
}
/*
* Is a deferred quiescent-state pending, and are we also not in
* an RCU read-side critical section? It is the caller's responsibility
* to ensure it is otherwise safe to report any deferred quiescent
Annotation
- Immediate include surface: `../locking/rtmutex_common.h`.
- Detected declarations: `function rcu_rdp_is_offloaded`, `function rcu_bootup_announce_oddness`, `function rcu_bootup_announce`, `function rcu_qs`, `function rcu_note_context_switch`, `function rcu_preempt_blocked_readers_cgp`, `function rcu_preempt_read_enter`, `function rcu_preempt_read_exit`, `function rcu_preempt_depth_set`, `function rcu_read_lock`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.