schedule_tail(9)
π schedule_tail(9) β from the Kernel API Manual, bestie
okay so real talk: this is a page from the Kernel API Manual (section 9, kernel developer land β¨), and honestly it's short but it is load-bearing. no cap.
πΈ NAME πΈ
schedule_tail β literally the first thing a freshly forked thread has to call. like, before it does anything else. main character energy for real π
β¨ SYNOPSIS β¨
__visible void schedule_tail (struct task_struct *prev );
yes that's the whole vibe. __visible void, returns nothing, takes one pointer. iconic.
π ARGUMENTS π
prevβ the thread we just switched away from. that's it, that's the whole arg. keep it close, bestie π«Ά
π¦ SEE ALSO π¦
so the source lives in the kernel file ./kernel/sched/core.c, and here's the whole friend group β go say hi:
wake_q_add(9)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_preempt_disabled(9)preempt_schedule_notrace(9)init_idle(9)curr_task(9)
ok tiny reminder since this is a kernel page and we respect the kernel: this is the first call a freshly forked thread makes. not the second, not the "whenever I feel like it" call. the first. π
and that's the page!! π mwah π this one came from ./kernel/sched, dated October 2026, and it's schedule_tail(9) β slay, go finish your task switch, 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