1 //po4a: entry man manual
5 Copyright (C) 2004 Robert Love
6 Copyright (C) 2015 Karel Zak <kzak@redhat.com>
8 This is free documentation; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License,
10 version 2, as published by the Free Software Foundation.
12 The GNU General Public License's references to "object code"
13 and "executables" are to be interpreted as the output of any
14 document formatting or typesetting system, including
15 intermediate and printed output.
17 This manual is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License along
23 with this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 :man manual: User Commands
29 :man source: util-linux {release-version}
36 chrt - manipulate the real-time attributes of a process
40 *chrt* [options] _priority command argument_ ...
42 *chrt* [options] *-p* [_priority_] _PID_
46 *chrt* sets or retrieves the real-time scheduling attributes of an existing _PID_, or runs _command_ with the given attributes.
51 Set scheduling policy to *SCHED_OTHER* (time-sharing scheduling). This is the default Linux scheduling policy.
54 Set scheduling policy to *SCHED_FIFO* (first in-first out).
57 Set scheduling policy to *SCHED_RR* (round-robin scheduling). When no policy is defined, the *SCHED_RR* is used as the default.
60 Set scheduling policy to *SCHED_BATCH* (scheduling batch processes). Linux-specific, supported since 2.6.16. The priority argument has to be set to zero.
63 Set scheduling policy to *SCHED_IDLE* (scheduling very low priority jobs). Linux-specific, supported since 2.6.23. The priority argument has to be set to zero.
66 Set scheduling policy to *SCHED_DEADLINE* (sporadic task model deadline scheduling). Linux-specific, supported since 3.14. The priority argument has to be set to zero. See also *--sched-runtime*, *--sched-deadline* and *--sched-period*. The relation between the options required by the kernel is runtime <= deadline <= period. *chrt* copies _period_ to _deadline_ if *--sched-deadline* is not specified and _deadline_ to _runtime_ if *--sched-runtime* is not specified. It means that at least *--sched-period* has to be specified. See *sched*(7) for more details.
70 *-T*, *--sched-runtime* _nanoseconds_::
71 Specifies runtime parameter for *SCHED_DEADLINE* policy (Linux-specific).
73 *-P*, *--sched-period* _nanoseconds_::
74 Specifies period parameter for *SCHED_DEADLINE* policy (Linux-specific).
76 *-D*, *--sched-deadline* _nanoseconds_::
77 Specifies deadline parameter for *SCHED_DEADLINE* policy (Linux-specific).
79 *-R*, *--reset-on-fork*::
80 Use *SCHED_RESET_ON_FORK* or *SCHED_FLAG_RESET_ON_FORK* flag. Linux-specific, supported since 2.6.31.
82 Each thread has a _reset-on-fork_ scheduling flag. When this flag is set, children created by *fork*(2) do not inherit privileged scheduling policies. After the _reset-on-fork_ flag has been enabled, it can be reset only if the thread has the *CAP_SYS_NICE* capability. This flag is disabled in child processes created by *fork*(2).
84 More precisely, if the _reset-on-fork_ flag is set, the following rules apply for subsequently created children:
86 * If the calling thread has a scheduling policy of *SCHED_FIFO* or *SCHED_RR*, the policy is reset to *SCHED_OTHER* in child processes.
88 * If the calling process has a negative nice value, the nice value is reset to zero in child processes.
93 Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID.
96 Show minimum and maximum valid priorities, then exit.
99 Operate on an existing PID and do not launch a new task.
102 Show status information.
104 include::man-common/help-version.adoc[]
108 //TRANSLATORS: Keep {colon} untranslated
109 The default behavior is to run a new command{colon}::
111 *chrt* _priority_ _command_ [_arguments_]
113 //TRANSLATORS: Keep {colon} untranslated
114 You can also retrieve the real-time attributes of an existing task{colon}::
118 //TRANSLATORS: Keep {colon} untranslated
121 *chrt -r -p* _priority PID_
123 This, for example, sets real-time scheduling to priority _30_ for the process _PID_ with the *SCHED_RR* (round-robin) class{colon}::
125 *chrt -r -p 30* _PID_
127 Reset priorities to default for a process{colon}::
131 See *sched*(7) for a detailed discussion of the different scheduler classes and how they interact.
135 A user must possess *CAP_SYS_NICE* to change the scheduling attributes of a process. Any user can retrieve the scheduling information.
139 Only *SCHED_FIFO*, *SCHED_OTHER* and *SCHED_RR* are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes may be ignored on some systems.
141 Linux' default scheduling policy is *SCHED_OTHER*.
145 mailto:rml@tech9.net[Robert Love],
146 mailto:kzak@redhat.com[Karel Zak]
155 See *sched_setscheduler*(2) for a description of the Linux scheduling scheme.
157 include::man-common/bugreports.adoc[]
159 include::man-common/footer.adoc[]
162 include::man-common/translation.adoc[]