bpf_wakeup_s...es_read_lock(9)
bpf_wakeup_s...es_read_lock(9)
okay bestie, this is the Kernel API Manual page for bpf_wakeup_s...es_read_lock(9) β yes, the name is a whole mouthful, but we're gonna get through it together π«Άβ¨
πΈ NAME πΈ
bpf_wakeup_sources_read_lock β acquire the SRCU lock for wakeup sources. that's the whole vibe π
β¨ SYNOPSIS β¨
__bpf_kfunc struct bpf_ws_lock * bpf_wakeup_sources_read_lock (void );
π ARGUMENTS π
voidβ no arguments. not a single one. it's giving "I travel light" π
π¦ DESCRIPTION π¦
so the underlying SRCU lock returns an integer index. but the BPF verifier is highkey strict: it requires a pointer (PTR_TO_BTF_ID) to strictly track the state of acquired resources using KF_ACQUIRE and KF_RELEASE semantics.
that's where the opaque structure pointer (struct bpf_ws_lock *) comes in β it satisfies the verifier while safely encoding the integer index within the pointer address itself. iconic little trick, no cap β¨
π RETURN π
an opaque pointer encoding the SRCU lock index + 1 (to avoid NULL). that + 1 is doing important work, bestie β no NULL energy allowed π
π₯ SEE ALSO π₯
Kernel file ./drivers/base/power/wakeup.c:
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_unlock(9)bpf_wakeup_sources_get_head(9)
signed off with source/version ./drivers/base/power and the date October 2026 β catch you in bpf_wakeup_s...es_read_lock(9) land, bestie π«Άπ
π¦ 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