task_prio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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/nice 0/[-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/nice 0

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 πŸ”₯


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