linux2.4 to linux2.6 kernel dispatch (5) __linux

Source: Internet
Author: User

Dispatch system code structure Most of the implementation code of scheduling system, including the definition of runqueue structure, all in the [KERNEL/SCHED.C] file, the purpose of this is to all the scheduling system code together, easy to update and replace. Unless otherwise noted, the code and function implementations cited herein are located in [KERNEL/SCHED.C].

3. The improved Task_struct

the 2.6 version of the kernel still uses task_struct to characterize the process, although the thread is optimized, but the thread's kernel representation is still the same as the process. With the improvement of dispatcher, the content of task_struct has been improved, and the new features of interactive process priority support and kernel preemption support are embodied in task_struct. In task_struct, some attributes are newly added, and the meaning of the values of some attributes changes, while some attributes simply change the name.

1) state

The status of the process is still represented by state, and the difference is that the state constants in 2.6 are redefined to facilitate bitwise manipulation:

/ * excerpt from [include/linux/sched.h] * *

#define TASK_RUNNING 0

#define TASK_INTERRUPTIBLE 1

#define Task_uninterruptible 2

#define TASK_STOPPED 4

#define Task_zombie 8

#define Task_dead

The newly added task_dead refers to processes that have exited and do not require a parent process to recycle.

2) Timestamp

the time that the process occurred scheduling events (in nanosecond, see below). Includes the following categories:

the time of being awakened (set in Activate_task ());

the time that was switched off (schedule ());

time to be switched (schedule ());

load-balancing-related assignments (see "Scheduler-related load Balancing").

from the difference between this value and the current time, you can obtain the information related to the priority calculation, such as the "Time to run in the ready queue" and "Run Time" (see "Optimized priority calculation Method").

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.