wake_q_add_safe(9)
π wake_q_add_safe(9) π
okay bestie, welcome to the Kernel API Manual page for wake_q_add_safe(9). This one is short but lowkey iconic because it's all about queueing a wakeup safely for later. β¨
πΈ NAME πΈ
wake_q_add_safe β safely queue a wakeup for 'later' waking. π
β¨ SYNOPSIS β¨
the whole signature, character-for-character, no edits bestie:
void wake_q_add_safe (struct wake_q_head *head , struct task_struct
*task );
π¦ ARGUMENTS π¦
headβ thewake_q_headto addtaskto. π«Άtaskβ the task to queue for'later'wakeup. β
π DESCRIPTION π
Queue a task for later wakeup, most likely by the wake_up_q call in the same context β HOWEVER, this is not guaranteed, and the wakeup can come instantly. π
This function must be used as-if it were wake_up_process; IOW the task must be ready to be woken at this location. No cap. π₯
This function is essentially a task-safe equivalent to wake_q_add. Callers that already hold reference to task can call the 'safe' version and trust wake_q to do the right thing depending whether or not the task is already queued for wakeup. π
π¨ vibe check: because the wakeup can come instantly, do not treat this as a guaranteed "later later" situation. The task has to be ready to be woken right here. periodt.
π SEE ALSO π
- Kernel file:
./kernel/sched/core.cπ§ wake_q_add(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)
made with π from./kernel/sched, October 2026, forwake_q_add_safe(9)β byeee bestie π«Ά
π¦ 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