Scheduling policies

Scheduling policies are applied to processes, and help in determining scheduling decisions. If you recall, in Chapter 1, Comprehending Processes, Address Space, and Threads, we described the int policy field under the scheduling attributes of struct task_struct. The policy field contains the value indicating which policy is to be applied to the process when scheduling. The CFS class handles all normal processes using the following two policies:

  • SCHED_NORMAL (0): This is used for all normal processes. All non-realtime processes can be summarized as normal processes. As Linux aims to be a highly responsive and interactive system, most of the scheduling activity and heuristics are centered to fairly schedule normal processes. Normal processes are referred to as SCHED_OTHER as per POSIX.
  • SCHED_BATCH (3): Normally in servers, where processes are non-interactive, CPU-bound batch processing is employed. These processes that are CPU intensive are given less priority than a SCHED_NORMAL process, and they do not preempt normal processes, which are scheduled.
  • The CFS class also handles scheduling the idle process, which is specified by the following policy:
  • SCHED_IDLE (5): When there are no processes to run, the idle process (low-priority background processes) is scheduled. The idle process is assigned the least priority among all processes.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.102.182