__wake_up_sync_key(9)
β¨ __wake_up_sync_key β¨
okay bestie, so you're deep in the kernel scheduler and you found this function β this is the __wake_up_sync_key(9) page from the Kernel API Manual, and honestly? it's giving "small function, big consequences" π
let's get into it.
πΈ NAME πΈ
__wake_up_sync_key β wake up threads blocked on a waitqueue.
like, that's the whole job. wake up the threads. that's it. icon behavior tbh π
π SYNOPSIS π
void __wake_up_sync_key (struct wait_queue_head *wq_head , unsigned int
mode , void *key );
copy it exactly, don't be creative with it, the compiler will NOT think that's cute π
π¦ ARGUMENTS π¦
wq_headβ the waitqueue. the hangout spot. the place where all the blocked threads are chilling π€modeβ which threads. yes, "which threads" is genuinely how specific the original is, so that's the level of detail we're working with, ngl π«Άkeyβ an opaque value that gets passed on through to the wakeup targets. opaque meaning we don't peek, we just deliver it π
π DESCRIPTION π
okay so the sync wakeup is a little different from your standard wakeup. the waker knows it's about to schedule away soon. so the target thread does get woken up, but it does not get migrated to another CPU β i.e. the two threads are 'synchronized' with each other. that's literally where the name comes from, iykyk β¨
and the glow-up? it can prevent needless bouncing between CPUs. no bouncing. none. we stay put. we slay π
on UP it can prevent extra preemption. small win, still a win π
and bestie, listen β if this function wakes up a task, it executes a full memory barrier before accessing the task state. that's a whole memory barrier. respect it π§ β‘
π SEE ALSO π
- Kernel file
./kernel/sched/wait.c __wake_up(9)__wake_up_locked_sync_key(9)finish_wait(9)
that's the whole page, no cap π short and sweet and honestly kind of iconic for it πΈ if you're going to remember one thing, remember the sync part β waker's leaving soon, so the target stays where it is, and nobody bounces between CPUs on your watch π
π this page lives under ./kernel/sched, dated October 2026, and it's the __wake_up_sync_key(9) entry in the Kernel API Manual β mwah, go read some kernel source, you're gonna do great β¨π«Άπ
π¦ 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