# Understand process priority

Unga unga888 at yahoo.com
Sat Dec 22 19:09:49 PST 2007

```Hi all

\$ ps -o pri,ni,rtprio,command -p `pgrep amarok`
PRI NI  RTPRIO COMMAND
20  0  normal amarokapp

1) Are there are 3 priority values per process, or
just one?

2) How should I read above? Is it Priority=20, ie.
NI=0, RTPRIO=normal? Does it all mean the same thing,
like the bytes=1048576 and KB=1024 and MB=1?

3) The rtprio(1) says "Priority is an integer between
0 and RTP_PRIO_MAX (usually 31).  0 is the highest
priority". But when I run following command:

\$ ps aux -o pri,ni,rtprio,command

USER     PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED
TIME COMMAND          PRI NI  RTPRIO COMMAND

root      10 99.2  0.0     0     8  ??  RL    7:40PM
0:00.00 [idle: cpu1]     171  0 idle:25 [idle: cpu1]

root      26  0.0  0.0     0     8  ??  WL    7:40PM
0:00.02 [irq18: envy24ht -80  0  intr:4 [irq18:
envy24ht

test  1212  0.0  9.3 58544 48176  ??  S     8:06PM
0:06.15 amarokapp         20  0  normal amarokapp

That is,
PID  PRI  NI  RTPRIO
10  171   0  idle:25
26  -80   0  intr:4
1212   20   0  normal

This shows priority ranges at least from -80 to 171
contrary to the range mentioned in rtprio(1). Does
this means PID=26 has a higher priority than PID=1212?

4) Can a PRI=0 be considered Realtime?

5) What is the meaning of priority=0 in

6) What is the value should I set for priority in