wake_q_add(9)
π 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β thewake_q_headyou're addingtaskto. it's literally the list you're throwing the task onto. πtaskβ thetaskyou'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:
wake_q_add_safe(9)task_curr(9)try_to_wake_up(9)task_call_func(9)cpu_curr_snapshot(9)wake_up_process(9)preempt_notifier_register(9)preempt_notifier_unregister(9)prepare_task_switch(9)finish_task_switch(9)schedule_tail(9)schedule_preempt_disabled(9)preempt_schedule_notrace(9)init_idle(9)curr_task(9)
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
- 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