System information

Tuning the Task Scheduler 171
SCHED_BATCH
Scheduling policy designed for CPU-intensive tasks.
SCHED_IDLE
Scheduling policy intended for very low prioritized tasks.
SCHED_OTHER
Default Linux time-sharing scheduling policy used by the majority of processes.
SCHED_RR
Similar to SCHED_FIFO, but uses the Round Robin scheduling algorithm.
14.4.5 Changing Real-time Attributes
ofProcesses with chrt
The chrt command sets or retrieves the real-time scheduling attributes of a running
process, or runs a command with the specified attributes. You can get or retrieve both
the scheduling policy and priority of a process.
In the following examples, a process whose PID is 16244 is used.
To retrieve the real-time attributes of an existing task:
saturn.example.com:~ # chrt -p 16244
pid 16244's current scheduling policy: SCHED_OTHER
pid 16244's current scheduling priority: 0
Before setting a new scheduling policy on the process, you need to find out the mini-
mum and maximum valid priorities for each scheduling algorithm:
saturn.example.com:~ # chrt -m
SCHED_OTHER min/max priority : 0/0
SCHED_FIFO min/max priority : 1/99
SCHED_RR min/max priority : 1/99
SCHED_BATCH min/max priority : 0/0
SCHED_IDLE min/max priority : 0/0
In the above example, SCHED_OTHER, SCHED_BATCH, SCHED_IDLE polices
only allow for priority 0, while that of SCHED_FIFO and SCHED_RR can range
from 1 to 99.
To set SCHED_BATCH scheduling policy: