Este conteúdo não está disponível no idioma selecionado.
Chapter 12. RHEL for Real Time scheduler
RHEL for Real Time uses the command line utilities help you to configure and monitor process configurations.
12.1. chrt utility for setting the scheduler Copiar o linkLink copiado para a área de transferência!
The chrt utility checks and adjusts scheduler policies and priorities. It can start new processes with the specified properties, or change the current properties of a running process.
The chrt utility takes the either --pid or the -p option to specify the process ID (PID).
The chrt utility takes the following policy options:
-
-for--fifo: sets the schedule toSCHED_FIFO. -
-oor--other: sets the schedule toSCHED_OTHER. -
-ror--rr: sets schedule toSCHED_RR. -
-dor--deadline: sets schedule toSCHED_DEADLINE.
The following example shows the attributes for a specified process.
# chrt -p 468
pid 468’s current scheduling policy: SCHED_FIFO
pid 468’s current scheduling priority: 85
12.2. Preemptive scheduling Copiar o linkLink copiado para a área de transferência!
Real-time preemption is the mechanism to temporarily interrupt an executing task, with the intention of resuming it later. It occurs when a higher priority process interrupts CPU usage. Preemption can negatively impact performance, and constant preemption can lead to thrashing, where processes are constantly preempted and no process ever runs completely. Changing task priority can help reduce involuntary preemption.
You can check for voluntary and involuntary preemption occurring on a single process by viewing the contents of the /proc/PID/status file, where PID is the process identifier.
The following example shows the preemption status of a process with PID 1000.
# grep voluntary /proc/1000/status
voluntary_ctxt_switches: 194529
nonvoluntary_ctxt_switches: 195338
12.3. Library functions for scheduler priority Copiar o linkLink copiado para a área de transferência!
The real-time processes use a different set of library calls to control policy and priority. The functions require the inclusion of the sched.h header file. The symbols SCHED_OTHER, SCHED_RR and SCHED_FIFO must also be defined in the sched.h header file.
The table lists the functions that set the policy and priority for the real-time scheduler.
| Functions | Description |
|---|---|
|
| Retrieves the scheduler policy for a specific process identifier (PID) |
|
|
Sets the scheduler policy and other parameters. This function requires three parameters: |
|
| Retrieves the scheduling parameters of a scheduling policy. |
|
|
Sets the parameters associated with a scheduling policy that has been already set and can be verified using the |
|
| Returns the maximum valid priority associated with the scheduling policy. |
|
| Returns the minimum valid priority associated with the scheduling policy . |
|
|
Displays the allocated |