1CHRT(1) User Commands CHRT(1)
2
3
4
6 chrt - manipulate the real-time attributes of a process
7
9 chrt [options] priority command argument ...
10
11 chrt [options] -p [priority] PID
12
14 chrt sets or retrieves the real-time scheduling attributes of an
15 existing PID, or runs command with the given attributes.
16
18 -o, --other
19 Set scheduling policy to SCHED_OTHER (time-sharing scheduling).
20 This is the default Linux scheduling policy.
21
22 -f, --fifo
23 Set scheduling policy to SCHED_FIFO (first in-first out).
24
25 -r, --rr
26 Set scheduling policy to SCHED_RR (round-robin scheduling). When no
27 policy is defined, the SCHED_RR is used as the default.
28
29 -b, --batch
30 Set scheduling policy to SCHED_BATCH (scheduling batch processes).
31 Linux-specific, supported since 2.6.16. The priority argument has
32 to be set to zero.
33
34 -i, --idle
35 Set scheduling policy to SCHED_IDLE (scheduling very low priority
36 jobs). Linux-specific, supported since 2.6.23. The priority
37 argument has to be set to zero.
38
39 -d, --deadline
40 Set scheduling policy to SCHED_DEADLINE (sporadic task model
41 deadline scheduling). Linux-specific, supported since 3.14. The
42 priority argument has to be set to zero. See also --sched-runtime,
43 --sched-deadline and --sched-period. The relation between the
44 options required by the kernel is runtime ⇐ deadline ⇐ period. chrt
45 copies period to deadline if --sched-deadline is not specified and
46 deadline to runtime if --sched-runtime is not specified. It means
47 that at least --sched-period has to be specified. See sched(7) for
48 more details.
49
51 -T, --sched-runtime nanoseconds
52 Specifies runtime parameter for SCHED_DEADLINE policy
53 (Linux-specific).
54
55 -P, --sched-period nanoseconds
56 Specifies period parameter for SCHED_DEADLINE policy
57 (Linux-specific). Note that the kernel’s lower limit is 100
58 milliseconds.
59
60 -D, --sched-deadline nanoseconds
61 Specifies deadline parameter for SCHED_DEADLINE policy
62 (Linux-specific).
63
64 -R, --reset-on-fork
65 Use SCHED_RESET_ON_FORK or SCHED_FLAG_RESET_ON_FORK flag.
66 Linux-specific, supported since 2.6.31.
67
68 Each thread has a reset-on-fork scheduling flag. When this flag is
69 set, children created by fork(2) do not inherit privileged
70 scheduling policies. After the reset-on-fork flag has been enabled,
71 it can be reset only if the thread has the CAP_SYS_NICE capability.
72 This flag is disabled in child processes created by fork(2).
73
74 More precisely, if the reset-on-fork flag is set, the following
75 rules apply for subsequently created children:
76
77 • If the calling thread has a scheduling policy of SCHED_FIFO or
78 SCHED_RR, the policy is reset to SCHED_OTHER in child
79 processes.
80
81 • If the calling process has a negative nice value, the nice
82 value is reset to zero in child processes.
83
85 -a, --all-tasks
86 Set or retrieve the scheduling attributes of all the tasks
87 (threads) for a given PID.
88
89 -m, --max
90 Show minimum and maximum valid priorities, then exit.
91
92 -p, --pid
93 Operate on an existing PID and do not launch a new task.
94
95 -v, --verbose
96 Show status information.
97
98 -h, --help
99 Display help text and exit.
100
101 -V, --version
102 Print version and exit.
103
105 The default behavior is to run a new command:
106
107 chrt priority command [arguments]
108
109 You can also retrieve the real-time attributes of an existing task:
110
111 chrt -p PID
112
113 Or set them:
114
115 chrt -r -p priority PID
116
117 This, for example, sets real-time scheduling to priority 30 for the
118 process PID with the SCHED_RR (round-robin) class:
119
120 chrt -r -p 30 PID
121
122 Reset priorities to default for a process:
123
124 chrt -o -p 0 PID
125
126 See sched(7) for a detailed discussion of the different scheduler
127 classes and how they interact.
128
130 A user must possess CAP_SYS_NICE to change the scheduling attributes of
131 a process. Any user can retrieve the scheduling information.
132
134 Only SCHED_FIFO, SCHED_OTHER and SCHED_RR are part of POSIX 1003.1b
135 Process Scheduling. The other scheduling attributes may be ignored on
136 some systems.
137
138 Linux' default scheduling policy is SCHED_OTHER.
139
141 Robert Love <rml@tech9.net>, Karel Zak <kzak@redhat.com>
142
144 nice(1), renice(1), taskset(1), sched(7)
145
146 See sched_setscheduler(2) for a description of the Linux scheduling
147 scheme.
148
150 For bug reports, use the issue tracker at
151 https://github.com/util-linux/util-linux/issues.
152
154 The chrt command is part of the util-linux package which can be
155 downloaded from Linux Kernel Archive
156 <https://www.kernel.org/pub/linux/utils/util-linux/>.
157
158
159
160util-linux 2.39.2 2023-08-17 CHRT(1)