Target of process scheduling, nice value, static priority, dynamic priority, real-time priority, time slice
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/