wake_up_var_locked(9)
π wake_up_var_locked(9) π
okay so bestie, welcome to the kernel API manual, this one's wake_up_var_locked and it is literally the "hey wake up, your variable's ready" girlie of the kernel β except she does it while holding a lock, which is the whole vibe β¨
πΈ NAME πΈ
wake_up_var_locked β wake up the waiters for a variable while you're holding a spinlock or a mutex π
π¦ SYNOPSIS π¦
wake_up_var_locked (var , lock );
π ARGUMENTS π
varβ the address of the variable that's being waited on. yes, the actual address, not the value, we're being specific here πlockβ the spinlock or mutex what protects the variable π (that's the original's grammar and I'm keeping it, it's iconic)
π DESCRIPTION π
So what she does is: send a wake up for the given variable, and that variable should be waited for with wait_var_event_spinlock or wait_var_event_mutex. match made in heaven, no cap π«Ά
And here's the slay part β unlike wake_up_var, no extra barriers are needed, because the locking provides sufficient sequencing. the lock is doing the heavy lifting, she's just showing up and being gorgeous β¨
fr fr though β this only makes sense if you're actually holding that lock, which is literally the name. the lock is the whole point, bestie π
π SEE ALSO π
Kernel file ./include/linux/wait_bit.h β go read her, she's the main character of this whole friend group π
wait_on_bit(9)wait_on_bit_io(9)wait_on_bit_timeout(9)wait_on_bit_action(9)wait_on_bit_lock(9)wait_on_bit_lock_io(9)wait_on_bit_lock_action(9)wait_var_event(9)wait_var_event_io(9)wait_var_event_killable(9)wait_var_event_timeout(9)wait_var_event_interruptible(9)wait_var_event_any_lock(9)wait_var_event_spinlock(9)wait_var_event_mutex(9)wake_up_var_protected(9)clear_and_wake_up_bit(9)test_and_clear_wake_up_bit(9)atomic_dec_and_wake_up(9)store_release_wake_up(9)
and that's the whole page, bestie, you ate that π
β¨ this lil gem lives in ./include/linux, dated October 2026, and it's wake_up_var_locked(9) β mwah, go wake something up (with the lock held, obviously) ππ
π¦ 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