来自 ps 手册页的 pri 注释:
“进程的pri PRI优先级。数字越大,优先级越低”
在这里考虑 PID 26073
$ renice +15 26073
26073: old priority 5, new priority 15 # I am making this process more nice
$ ps -t 1 -o pid,ppid,%cpu,stat,cmd,bsdstart,time,pri
PID PPID %CPU STAT CMD START TIME PRI
9115 18136 0.0 Ss bash 17:10 00:00:01 19
26073 9115 12.0 RN+ p4 sync 19:06 00:02:56 4
STAT = RN+ 这意味着:正在运行,低优先级(对其他人很好),前景。优先级=4 (1)
$ sudo renice -10 26073
26073: old priority 15, new priority -10 # I am making this process less nice
$ ps -t 1 -o pid,ppid,%cpu,stat,cmd,bsdstart,time,pri
PID PPID %CPU STAT CMD START TIME PRI
9115 18136 0.0 Ss bash 17:10 00:00:01 19
26073 9115 12.0 S<+ p4 sync 19:06 00:03:15 29
STAT = S<+ 这意味着:可中断睡眠,高优先级(对其他人不好),前景。优先级=29 (2)
在情况 2 中,进程优先级增加,或者换句话说,进程变得更高优先级。
但这与手册页中 pri 的定义相矛盾(数字越大意味着优先级越低)