Kernel learning process scheduling goals, nice value, static priority and dynamic priority

Source: Internet
Author: User

Target of process scheduling:

1, efficiency: High efficiency means that in the same time to complete more tasks. The scheduler is executed frequently, so the scheduler is as efficient as possible.

2, enhance interactive performance (interactivity): In the system equivalent to the load, but also to ensure that the system response time.

3, to ensure fairness and avoid hunger and thirst.

4, SMP scheduling: The scheduler must support a multiple processing system. The system must track which processes are running on which CPU. Make sure that one process cannot run more than 1 CPUs at the same time.

5, soft real-time scheduling (soft real-timescheduling): The system must effectively call the real-time process.

"I think the scheduler is not perfect at any time, the right one is not either or, the choice is a kind of balance," Linustorvalds said in a CFS blend into 2.6.23. Before I change the scheduler, I am 100% sure I will change it in the future. Scheduler is not as important as it is supposed to be, it is just a part of the kernel. ”

The nice value of the process:

The nice value is an attribute of each process. It is not a priority of the process, but a number that can affect the priority level.

The NI column shows the nice value of each process, and the PRI is the priority of the process.

Nice is an integer between -20~~19, which takes the median value 0 by default.

The current kernel no longer stores nice values. Instead, Static_prio (static priority). Nice values are visible to the user, static precedence is hidden in the kernel, and nice values and static priorities can be converted by a certain relational process. So the nice value only affects the static priority level. For ordinary processes, dynamic precedence is based on static precedence.

Priority level:

Common processes are: static priority and dynamic precedence. Real-time processes also add real-time priority.

Note: The priority of a process is just an integer, which is the basis for the scheduler to select a process to run.

1. Static priority: The static priority: The reason why it is known as quiescent priority is because it does not change over time, the kernel does not modify it, it can only be modified by system call Nice. Static precedence is represented by Static_prio in the process descriptor. Its relationship with Nice is as follows:

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/unix/

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.