kernel/rcu/update.c
Source file repositories/reference/linux-study-clean/kernel/rcu/update.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/rcu/update.c- Extension
.c- Size
- 21468 bytes
- Lines
- 701
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/kernel.hlinux/init.hlinux/spinlock.hlinux/smp.hlinux/interrupt.hlinux/sched/signal.hlinux/sched/debug.hlinux/torture.hlinux/atomic.hlinux/bitops.hlinux/percpu.hlinux/notifier.hlinux/cpu.hlinux/mutex.hlinux/export.hlinux/hardirq.hlinux/delay.hlinux/moduleparam.hlinux/kthread.hlinux/tick.hlinux/rcupdate_wait.hlinux/sched/isolation.hlinux/kprobes.hlinux/slab.hlinux/irq_work.hlinux/rcupdate_trace.hrcu.htasks.h
Detected Declarations
struct early_boot_kfree_rcufunction rcu_read_lock_held_commonfunction rcu_read_lock_sched_heldfunction rcu_set_runtime_modefunction call_rcufunction rcu_async_hurryfunction rcu_async_relaxfunction rcu_expedite_gpfunction synchronize_rcu_expeditedfunction rcu_expedite_gpfunction rcu_end_inkernel_bootfunction rcu_inkernel_boot_has_endedfunction rcu_test_sync_primsfunction rcu_set_runtime_modefunction debug_lockdep_rcu_enabledfunction rcu_read_lock_heldfunction rcu_read_lock_bh_heldfunction rcu_read_lock_any_heldfunction wakeme_after_rcufunction __wait_rcu_gpfunction finish_rcuwaitfunction init_rcu_headfunction destroy_rcu_headfunction rcuhead_is_static_objectfunction init_rcu_head_on_stackfunction destroy_rcu_head_on_stackfunction do_trace_rcu_torture_readfunction torture_sched_setaffinityfunction synchronize_rcu_trivial_preemptfunction poll_state_synchronize_rcufunction test_callbackfunction early_boot_test_call_rcufunction rcu_early_boot_testsfunction rcu_verify_early_boot_testsfunction rcu_early_boot_testsmodule init rcu_set_runtime_modeexport rcu_read_lock_sched_heldexport rcu_gp_is_normalexport rcu_async_should_hurryexport rcu_async_hurryexport rcu_async_relaxexport rcu_gp_is_expeditedexport rcu_expedite_gpexport rcu_unexpedite_gpexport rcu_inkernel_boot_has_endedexport rcu_lock_mapexport rcu_bh_lock_mapexport rcu_sched_lock_map
Annotated Snippet
* core_initcall() is invoked, at which point everything is expedited.)
*/
bool rcu_gp_is_normal(void)
{
return READ_ONCE(rcu_normal) &&
rcu_scheduler_active != RCU_SCHEDULER_INIT;
}
EXPORT_SYMBOL_GPL(rcu_gp_is_normal);
static atomic_t rcu_async_hurry_nesting = ATOMIC_INIT(1);
/*
* Should call_rcu() callbacks be processed with urgency or are
* they OK being executed with arbitrary delays?
*/
bool rcu_async_should_hurry(void)
{
return !IS_ENABLED(CONFIG_RCU_LAZY) ||
atomic_read(&rcu_async_hurry_nesting);
}
EXPORT_SYMBOL_GPL(rcu_async_should_hurry);
/**
* rcu_async_hurry - Make future async RCU callbacks not lazy.
*
* After a call to this function, future calls to call_rcu()
* will be processed in a timely fashion.
*/
void rcu_async_hurry(void)
{
if (IS_ENABLED(CONFIG_RCU_LAZY))
atomic_inc(&rcu_async_hurry_nesting);
}
EXPORT_SYMBOL_GPL(rcu_async_hurry);
/**
* rcu_async_relax - Make future async RCU callbacks lazy.
*
* After a call to this function, future calls to call_rcu()
* will be processed in a lazy fashion.
*/
void rcu_async_relax(void)
{
if (IS_ENABLED(CONFIG_RCU_LAZY))
atomic_dec(&rcu_async_hurry_nesting);
}
EXPORT_SYMBOL_GPL(rcu_async_relax);
static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1);
/*
* Should normal grace-period primitives be expedited? Intended for
* use within RCU. Note that this function takes the rcu_expedited
* sysfs/boot variable and rcu_scheduler_active into account as well
* as the rcu_expedite_gp() nesting. So looping on rcu_unexpedite_gp()
* until rcu_gp_is_expedited() returns false is a -really- bad idea.
*/
bool rcu_gp_is_expedited(void)
{
return rcu_expedited || atomic_read(&rcu_expedited_nesting);
}
EXPORT_SYMBOL_GPL(rcu_gp_is_expedited);
/**
* rcu_expedite_gp - Expedite future RCU grace periods
*
* After a call to this function, future calls to synchronize_rcu() and
* friends act as the corresponding synchronize_rcu_expedited() function
* had instead been called.
*/
void rcu_expedite_gp(void)
{
atomic_inc(&rcu_expedited_nesting);
}
EXPORT_SYMBOL_GPL(rcu_expedite_gp);
/**
* rcu_unexpedite_gp - Cancel prior rcu_expedite_gp() invocation
*
* Undo a prior call to rcu_expedite_gp(). If all prior calls to
* rcu_expedite_gp() are undone by a subsequent call to rcu_unexpedite_gp(),
* and if the rcu_expedited sysfs/boot parameter is not set, then all
* subsequent calls to synchronize_rcu() and friends will return to
* their normal non-expedited behavior.
*/
void rcu_unexpedite_gp(void)
{
atomic_dec(&rcu_expedited_nesting);
}
EXPORT_SYMBOL_GPL(rcu_unexpedite_gp);
static bool rcu_boot_ended __read_mostly;
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/init.h`, `linux/spinlock.h`, `linux/smp.h`, `linux/interrupt.h`, `linux/sched/signal.h`, `linux/sched/debug.h`.
- Detected declarations: `struct early_boot_kfree_rcu`, `function rcu_read_lock_held_common`, `function rcu_read_lock_sched_held`, `function rcu_set_runtime_mode`, `function call_rcu`, `function rcu_async_hurry`, `function rcu_async_relax`, `function rcu_expedite_gp`, `function synchronize_rcu_expedited`, `function rcu_expedite_gp`.
- 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.