NI 是优先值,是用户层面的概念, PR是进程的实际优先级, 是给内核(kernel)看(用)的。
一般情况下,PR=NI+20, 如果一个进程的优先级PR是20, 那么它的NI(nice)值就是20-20=0。
NI is the nice value, which is a user-space concept. PR is the process's actual priority, as viewed by the Linux kernel.
For normal processes, the kernel priority is simply +20 from the nice value. Thus a process with the neutral nice value of zero has a kernel priority of 20. This offset-by-20 is done so that a process with a nice value of -20, the highest priority nice value, receives a kernel priority of zero. Lower numeric values equal higher scheduling priority.
For realtime processes, the kernel priority is the process's real-time priority, but the
PR column will simply print
RT.
In some versions of the Linux kernel, the kernel priority could differ from the nice value, as the process scheduler applied a small bonus or punishment to interactive or processor-hogging tasks, respectively. In these older kernels, the value given by the
PR column could differ from the nice value. This isn't true with the kernel's current scheduler, the Completely Fair Scheduler (CFS).
This article come from:
转自:http://blog.sina.com.cn/s/blog_6dab997f0101dhjf.html
阅读(3168) | 评论(0) | 转发(0) |