__wake_up(9)
π« __wake_up β the Kernel API Manual, bestie edition π«
okay so real talk, this one is a <pink>Kernel API Manual</pink> page for a function literally called __wake_up, and it is the girl who wakes up threads blocked on a waitqueue. she is small, she is powerful, she is doing the most. let's get into it π«Ά
β¨ NAME β¨
__wake_up β wake up threads blocked on a waitqueue.
no cap, that's the whole job description. she wakes the sleepy ones up π
πΈ SYNOPSIS πΈ
int __wake_up (struct wait_queue_head *wq_head , unsigned int mode , int
nr_exclusive , void *key );
look at her. four args, returns an int, iconic behavior only π
π ARGUMENTS π
wq_headβ the waitqueue. this is literally the queue and bestie's whole entire world, so like, be nice to it π¦modeβ which threads. yes the whole vibe check of "who are we actually waking here" lives in this one argument β¨nr_exclusiveβ how many wake-one or wake-many threads to wake up. so like, are we doing a solo wake or a whole group chat situation, this arg decides πkeyβ is directly passed to the wakeup function. not read, not verified, not questioned. just handed straight over, main character energy fr fr π₯
π§ DESCRIPTION π§
okay so here's the actual tea.
if this function wakes up a task, it executes a full memory barrier before accessing the task state. so like, no sneaky reordering happening, the memory ordering is handled. periodt. π
and she returns the number of exclusive tasks that were awaken. yep β that's a return value, that's real, that's the receipt for how many exclusive besties got the wake-up π
π SEE ALSO π
kernel file ./kernel/sched/wait.c β and honestly go read it, it's giving source code chic:
β οΈ friendly reminder bestie: the return value counts the exclusive tasks that were awaken, not every task. read the number correctly or the vibe check fails π
βq°⩠and that's the page!! βq°β©
this masterpiece of documentation lives over in ./kernel/sched, and the version is dated October 2026 πΈ β so if you're quoting it, cite __wake_up(9) from ./kernel/sched like the academic icon you are ππ
slay, bye π¦
π¦ 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