lib/flex_proportions.c
Source file repositories/reference/linux-study-clean/lib/flex_proportions.c
File Facts
- System
- Linux kernel
- Corpus path
lib/flex_proportions.c- Extension
.c- Size
- 5583 bytes
- Lines
- 203
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source 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.
- 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/flex_proportions.h
Detected Declarations
function fprop_global_initfunction fprop_global_destroyfunction fprop_new_periodfunction fprop_local_init_percpufunction fprop_local_destroy_percpufunction fprop_reflect_period_percpufunction __fprop_add_percpufunction fprop_fraction_percpufunction __fprop_add_percpu
Annotated Snippet
if (tmp < 0) {
/* Maximum fraction already exceeded? */
return;
} else if (tmp < nr * (FPROP_FRAC_BASE - max_frac)) {
/* Add just enough for the fraction to saturate */
nr = div_u64(tmp + FPROP_FRAC_BASE - max_frac - 1,
FPROP_FRAC_BASE - max_frac);
}
}
__fprop_add_percpu(p, pl, nr);
}
Annotation
- Immediate include surface: `linux/flex_proportions.h`.
- Detected declarations: `function fprop_global_init`, `function fprop_global_destroy`, `function fprop_new_period`, `function fprop_local_init_percpu`, `function fprop_local_destroy_percpu`, `function fprop_reflect_period_percpu`, `function __fprop_add_percpu`, `function fprop_fraction_percpu`, `function __fprop_add_percpu`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source 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.