bpf_wakeup_s..._read_unlock(9)
π bpf_wakeup_s..._read_unlock(9) β a Kernel API Manual moment
okay so this is section 9 of the Kernel API Manual, and bestie, we're talking about bpf_wakeup_s..._read_unlock β yes the name is a whole entire keyboard smash, we don't make the rules, we just document them π
β¨ NAME β¨
bpf_wakeup_sources_read_unlock β releases the SRCU lock for wakeup sources. that's it. that's the job. she opens the door and lets everybody out πͺπ¦
πΈ SYNOPSIS πΈ
__bpf_kfunc void bpf_wakeup_sources_read_unlock (struct bpf_ws_lock *lock );
π ARGUMENTS π
lockβ the opaque pointer you got back frombpf_wakeup_sources_read_lock. no cap, it's opaque, you're not supposed to peek inside it, just hand it back like a library book π«Ά
π DESCRIPTION π
so here's the tea β: the BPF verifier has already done the vibe check for you β it guarantees that lock is a valid, unreleased pointer that came from the acquire function. so you literally cannot fumble this. she checked, she signed off, it's iconic.
then we do the actual bit: we decode the pointer back into the integer SRCU index by subtracting 1, and we release the lock. one (1) minus. that's the whole trick. ate and left no crumbs π₯
ngl it looks like nothing, but this is the release half of an acquire/release pair β the matching unlock for bpf_wakeup_sources_read_lock. keep the pair together, periodt.
π« SEE ALSO π«
Kernel file: ./drivers/base/power/wakeup.c β and the whole friend group:
wakeup_source_create(9)wakeup_source_destroy(9)wakeup_source_add(9)wakeup_source_remove(9)wakeup_source_register(9)wakeup_source_unregister(9)wakeup_sources_read_lock(9)wakeup_sources_read_unlock(9)wakeup_sources_walk_start(9)wakeup_sources_walk_next(9)device_wakeup_attach(9)device_wakeup_enable(9)device_wakeup_attach_irq(9)device_wakeup_detach_irq(9)device_wakeup_arm_wake_irqs(9)device_wakeup_disarm_wake_irqs(9)device_wakeup_detach(9)device_wakeup_disable(9)device_set_wakeup_capable(9)device_set_wakeup_enable(9)wakeup_source_not_usable(9)wakeup_source_activate(9)wakeup_source_report_event(9)__pm_stay_awake(9)pm_stay_awake(9)wakeup_source_deactivate(9)__pm_relax(9)pm_relax(9)pm_wakeup_timer_fn(9)pm_wakeup_ws_event(9)pm_wakeup_dev_event(9)pm_wakeup_pending(9)pm_get_wakeup_count(9)pm_save_wakeup_count(9)pm_wakep_autosleep_enabled(9)print_wakeup_source_stats(9)wakeup_sources_stats_seq_show(9)bpf_wakeup_sources_read_lock(9)bpf_wakeup_sources_get_head(9)
mwah, that's a wrap π§π this lil page lives over in ./drivers/base/power, dated October 2026 β go forth and unlock responsibly, bestie. bpf_wakeup_s..._read_unlock(9) out! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms