lib/percpu_counter.c
Source file repositories/reference/linux-study-clean/lib/percpu_counter.c
File Facts
- System
- Linux kernel
- Corpus path
lib/percpu_counter.c- Extension
.c- Size
- 10932 bytes
- Lines
- 408
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- 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
linux/percpu_counter.hlinux/mutex.hlinux/init.hlinux/cpu.hlinux/module.hlinux/debugobjects.h
Detected Declarations
function percpu_counter_fixup_freefunction debug_percpu_counter_activatefunction debug_percpu_counter_deactivatefunction debug_percpu_counter_activatefunction this_cpu_addfunction local_irq_savefunction percpu_counter_syncfunction percpu_counter_read_positivefunction __percpu_counter_init_manyfunction percpu_counter_destroy_manyfunction compute_batch_valuefunction percpu_counter_cpu_deadfunction __percpu_counter_comparefunction amountsfunction for_each_cpu_orfunction percpu_counter_startupmodule init percpu_counter_startupexport percpu_counter_setexport percpu_counter_add_batchexport percpu_counter_syncexport __percpu_counter_sumexport __percpu_counter_init_manyexport percpu_counter_destroy_manyexport percpu_counter_batchexport __percpu_counter_compare
Annotated Snippet
module_init(percpu_counter_startup);
Annotation
- Immediate include surface: `linux/percpu_counter.h`, `linux/mutex.h`, `linux/init.h`, `linux/cpu.h`, `linux/module.h`, `linux/debugobjects.h`.
- Detected declarations: `function percpu_counter_fixup_free`, `function debug_percpu_counter_activate`, `function debug_percpu_counter_deactivate`, `function debug_percpu_counter_activate`, `function this_cpu_add`, `function local_irq_save`, `function percpu_counter_sync`, `function percpu_counter_read_positive`, `function __percpu_counter_init_many`, `function percpu_counter_destroy_many`.
- Atlas domain: Kernel Services / lib.
- 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.