Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prio, static_prio, rt_priority in Linux Kernel

What is the difference between each value of task_struct?

like image 809
koreshok Avatar asked Apr 24 '11 13:04

koreshok


1 Answers

Here's my notes on the priority fields. I also include how data is presented via the 'ps' command (which gets it's data from /proc/pid/stat, among other things).

task_struct.prio:
    0-99 -> Realtime
    100-140 -> Normal priority

ps/stat "prio" field:
    task_struct.prio - MAX_RT_PRIO (100)
    (-100)-(-1) -> Realtime
    0-40 -> Normal Priority

stat "rt_priority" field:
    0 -> normal
    1-99 -> realtime

stat "policy" field:
    0 -> SCHED_OTHER (normal)
    1 -> SCHED_FIFO
    2 -> SCHED_RR (realtime)
like image 86
MikeK Avatar answered Sep 30 '22 20:09

MikeK