task_prio(9)
β¨ NAME β¨
okay so this is task_prio from the Kernel API Manual (section 9, bestie, we're in the kernel now π
) β and it literally just returns the priority value of a given task. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
int task_prio (const struct task_struct *p );
that's the whole call fr fr, no cap β¨
π¦ ARGUMENTS π¦
pβ the task in question. like, the specific task you're being nosy about π
π RETURN π
it hands you back the priority value as seen by users in /proc β so it's the version of the number that the user-facing side of things actually shows you. icon behaviour, honestly.
π DESCRIPTION π
bestie this is the part where it gets good β here's how the different sched policies map across the three priority worlds. the way that return value and kernel prio and user prio/nice are three whole different languages and this function is the translator π
normal,batch,idleβ return value[0 ... 39], kernel prio[100 ... 139], user prio/nice0/[-20 ... 19]fifo,rrβ return value[-2 ... -100], kernel prio[98 ... 0], user prio/nice[1 ... 99]deadlineβ return value-101, kernel prio-1, user prio/nice0
like yes the ranges go in opposite directions for fifo/rr, no I will not be explaining why at 2am, just trust the chart π«Ά
π SEE ALSO π
the full squad, and honestly? they ate. go read these next π₯
- Kernel file
./kernel/sched/syscalls.c idle_cpu(9)idle_task(9)find_process_by_pid(9)sched_setscheduler(9)sched_setscheduler_nocheck(9)sys_sched_setscheduler(9)sys_sched_setparam(9)sys_sched_setattr(9)sys_sched_getscheduler(9)sys_sched_getparam(9)sys_sched_getattr(9)sys_sched_setaffinity(9)sys_sched_getaffinity(9)sys_sched_yield(9)yield(9)yield_to(9)sys_sched_get_priority_max(9)sys_sched_get_priority_min(9)sys_sched_rr_get_interval(9)
ok that's the whole page bestie, go forth and check your priorities ππ
mwah, this came from ./kernel/sched in October 2026 β task_prio(9), section 9, signing off π§ββοΈβ
π¦ 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