ULK --- Chap3 Processes: Lists of Tasking_Running processes

When looking for a new process to run on a CPU, the kernel has to consider only the runnable processes

(that is, the processes in the TASK_RUNNING state).

Earlier Linux version put all runnable processes in the same list called runqueue. Because it would be too

costly to maintain the list ordered according to process priorities, the earlier schedulers were compelled 

to scan the whole list in order to select the best runnable process.

Linux 2.6 implements the runqueue differently. The aim is to allow the scheduler to select the best runnable

process in constant time, independently of the number of runnable processes. We will defer to Chapter 7 a 

detailed description of this new kind of runqueue, and we will provide here only some basic information.

The trick used to achieve the scheduler speedup consists of spliting the runqueue in many lists of runnable

processes, one list per process priority. Each task_struct descriptor includes a run_list field of type list_head.

If the process priority is equal to k (a value ranging between 0 and 139), the run_list field links the process

descriptor into the list of runnable processes having priority k. Furthermore, on a multiprocessor system, each

CPU has its own runqueue, that is, its own set of lists of processes. This is a classic example of making a data

structures more complex to improve performance: to make scheduler operation more efficient, the runqueue

list has been split into 140 different lists!

转载于:https://www.cnblogs.com/miaoyong/p/4948920.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值