__wake_up(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« __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 😭

β‹†ο½‘Β°βœ© and that's the page!! β‹†ο½‘Β°βœ©

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