kernel/bpf/dispatcher.c
Source file repositories/reference/linux-study-clean/kernel/bpf/dispatcher.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/bpf/dispatcher.c- Extension
.c- Size
- 4318 bytes
- Lines
- 172
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: implementation source
- Status
- source 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.
- 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/hash.hlinux/bpf.hlinux/filter.hlinux/static_call.h
Detected Declarations
function bpf_dispatcher_add_progfunction bpf_dispatcher_remove_progfunction arch_prepare_bpf_dispatcherfunction bpf_dispatcher_preparefunction bpf_dispatcher_updatefunction bpf_dispatcher_change_prog
Annotated Snippet
if (!d->rw_image) {
bpf_prog_pack_free(d->image, PAGE_SIZE);
d->image = NULL;
goto out;
}
bpf_image_ksym_init(d->image, PAGE_SIZE, &d->ksym);
bpf_image_ksym_add(&d->ksym);
}
prev_num_progs = d->num_progs;
changed |= bpf_dispatcher_remove_prog(d, from);
changed |= bpf_dispatcher_add_prog(d, to);
if (!changed)
goto out;
bpf_dispatcher_update(d, prev_num_progs);
out:
mutex_unlock(&d->mutex);
}
Annotation
- Immediate include surface: `linux/hash.h`, `linux/bpf.h`, `linux/filter.h`, `linux/static_call.h`.
- Detected declarations: `function bpf_dispatcher_add_prog`, `function bpf_dispatcher_remove_prog`, `function arch_prepare_bpf_dispatcher`, `function bpf_dispatcher_prepare`, `function bpf_dispatcher_update`, `function bpf_dispatcher_change_prog`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- 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.