According to the some resources I have read, the process with low nice value has more priority. Because it has more priority, CPU allocates more time for that process.
However, it sounds a little bit weird because priority value of a process is calculated by summing nice value with 20.
PR = NI + 20. This can be seen easily with the command top
According to this formula, the processes with higher nice values have higher priorities, but some resources says that the process with low nice value has more priority.
Which one is true ?
Best Answer
Close, but no cookie. That the numeric value of priority is high doesn't mean the priority is high.
top
reads the priority from/proc/<pid>/stat
. Seeman 5 proc
for the explanation of that file:So: PR goes from 0 (high) to 39 (low).