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!

时间: 2024-10-09 20:08:19

ULK --- Chap3 Processes: Lists of Tasking_Running processes的相关文章

ULK --- Chap3 Processes: How Processes Are Organized

The runqueue lists group all processes in a  TASK_RUNNING state. When it comes to grouping processes in other states, the various states call for different types of treatment, with Linux opting for one of choices shown in the following list. Processe

ULK --- Chap3 Processes: Doubly linked lists

Before moving to and describing how the kernel keeps track of the various processes in the system, we would like to emphasize the role of special data structures that implement doubly linked lists. For each list, a set of primitives operations must b

ULK --- Chap3 Processes

The concept of a process is fundamental to any multiprogramming operating system. A process is usually defined as an instance of a program in execution; thus, if 16 users are running vi at once, there are 16 separate processes (although they can shar

ULK --- Chap3 Processes: Relationships Among Processes

Processes created by a  program have a parent/child relationship. When a process creates multiple children, these children have sibling relationships. Several fields must be introduced in a process descriptor to represent these relationships; Process

ULK --- Chap3 Processes: Identifying a Process

As a general rule, each execution context that can be independently scheduled must have its own process descriptor; therefore, even lightweight processes, which share a large portion of their kernel data structures, have their own task_struct structu

ULK --- Chap3 Processes: Process Descriptor Handling

Processes are dynamic entities whose lifetimes range from a few milliseconds to months. Thus, the kernel must be able to handle many processes at the same time, and process descriptors are stored in dynamic memory rather than in the memory area perma

2013 UBC Machine Learning NO.7 Introduction to Gaussian Processes NO.8 Gaussian Processes

原文地址:https://www.cnblogs.com/ecoflex/p/9122942.html

Target Devices and Processes

Target Devices and Processes 为了使用跟踪文档对某些内容进行配置,需要对其进行目标定位.也就是说,您需要告诉仪器您想要什么样的配置文件,以及您想要对它进行什么样的配置,例如在设备上或模拟器中.In order to profile something with a trace document, you need to target it. That is, you need to tell Instruments what you want to profile a

Show All Running Processes in Linux

ps由于历史的原因,所以很奇特,有些命令必须加"-",比如: ps A 上面的写法是错误的 ********* simple selection ********* ********* selection by list ********* -A all processes -C by command name -N negate selection -G by real group ID (supports names) -a all w/ tty except session le