The description of the RT offset and the values for 'normal' tasks needs update. Moreover there are DL tasks now. task_prio() has to stay like it is to guarantee compatibility with the /proc/<pid>/stat priority field: # cat /proc/<pid>/stat | awk '{ print $18; }'
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -5616,8 +5616,12 @@ SYSCALL_DEFINE1(nice, int, increment) · 5615 unmodified lines | |||
| 5616 | * @p: the task in question. | 5616 | * @p: the task in question. |
| 5617 | * | 5617 | * |
| 5618 | * Return: The priority value as seen by users in /proc. | 5618 | * Return: The priority value as seen by users in /proc. |
| 5619 | * RT tasks are offset by -200. Normal tasks are centered | 5619 | * |
| 5620 | * around 0, value goes from -16 to +15. | 5620 | * sched policy return value kernel prio user prio/nice |
| 5621 | * | ||
| 5622 | * normal, batch, idle [0 ... 39] [100 ... 139] 0/[-20 ... 19] | ||
| 5623 | * fifo, rr [-2 ... -100] [98 ... 0] [1 ... 99] | ||
| 5624 | * deadline -101 -1 0 | ||
| 5621 | */ | 5625 | */ |
| 5622 | int task_prio(const struct task_struct *p) | 5626 | int task_prio(const struct task_struct *p) |
| 5623 | { | 5627 | { |