wake_q_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– wake_q_add(9) β€” or, "girl help I'm queuing a wakeup" πŸ’–

okay so you're in the Kernel API Manual (yes that's the manual name, we're fancy here πŸ‘‘) and you've stumbled onto wake_q_add(9). bestie, sit down, this one is short and sweet and also has a little gotcha that we WILL be discussing. 🫢


✨ NAME ✨

wake_q_add β€” queue a wakeup for 'later' waking.

like, a rain check for waking a task up. πŸ’…


🌸 SYNOPSIS 🌸

void wake_q_add (struct wake_q_head *head , struct task_struct *task );

that's it. that's the whole signature. two args, void return, no drama. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • head β€” the wake_q_head you're adding task to. it's literally the list you're throwing the task onto. πŸ“‹
  • task β€” the task you're queueing up for a 'later' wakeup. the sleepy little guy. 😴

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: you queue a task for a later wakeup, most likely by the wake_up_q call in the same context. that's the plan, that's the dream. πŸ’­

BUT β€” and she said what she said β€” _HOWEVER_ this is not guaranteed. the wakeup can come instantly. like, no warning, icon behaviour, it just happens. ⚑ so don't build your whole personality around "it'll definitely happen later." πŸ™ˆ

ok now the important part, pay attention: this function must be used as-if it were wake_up_process. IOW β€” in other words, iykyk β€” the task must be ready to be woken at this location. that's a real requirement, not a suggestion, so please don't @ me. πŸ”₯

🌈 SEE ALSO 🌈

go read these too, they're all in the Kernel file ./kernel/sched/core.c and they're all lowkey iconic:

that's the whole reading list, bestie. study up, there will be a vibes-based quiz. πŸ“šβœ¨


mwah πŸ’‹ that's a wrap, ily, go queue some wakeups responsibly. this page came out of ./kernel/sched and it's dated October 2026 β€” so like, from the future, which honestly tracks. periodt. πŸ¦‹πŸŽ€πŸ’œ

πŸ“¦ where this page comes from