Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3494934
  • 博文数量: 534
  • 博客积分: 11595
  • 博客等级: 上将
  • 技术积分: 5785
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-22 17:00
文章分类

全部博文(534)

文章存档

2015年(4)

2014年(27)

2013年(15)

2012年(38)

2011年(36)

2010年(85)

2009年(63)

2008年(142)

2007年(124)

分类: LINUX

2014-10-09 21:16:47

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 thePR 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) |
给主人留下些什么吧!~~