# CHRT(1) - man - phpman

[CHRT(1)](https://www.chedong.com/phpMan.php/man/CHRT/1/markdown)                                     User Commands                                    [CHRT(1)](https://www.chedong.com/phpMan.php/man/CHRT/1/markdown)



## NAME
       chrt - manipulate the real-time attributes of a process

## SYNOPSIS
       **chrt** [options] _priority_ _command_ _argument_ ...

       **chrt** [options] **-p** [_priority_] _PID_

## DESCRIPTION
       **chrt** sets or retrieves the real-time scheduling attributes of an existing _PID_, or runs
       _command_ with the given attributes.

## POLICIES
### -o --other
           Set scheduling policy to **SCHED**___**OTHER** (time-sharing scheduling). This is the default Linux
           scheduling policy.

### -f --fifo
           Set scheduling policy to **SCHED**___**FIFO** (first in-first out).

### -r --rr
           Set scheduling policy to **SCHED**___**RR** (round-robin scheduling). When no policy is defined,
           the **SCHED**___**RR** is used as the default.

### -b --batch
           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.

### -i --idle
           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.

### -d --deadline
           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)](https://www.chedong.com/phpMan.php/man/sched/7/markdown)
           for more details.

## SCHEDULING OPTIONS
### -T --sched-runtime
           Specifies runtime parameter for **SCHED**___**DEADLINE** policy (Linux-specific).

### -P --sched-period
           Specifies period parameter for **SCHED**___**DEADLINE** policy (Linux-specific).

### -D --sched-deadline
           Specifies deadline parameter for **SCHED**___**DEADLINE** policy (Linux-specific).

### -R --reset-on-fork
           Use **SCHED**___**RESET**___**ON**___**FORK** or **SCHED**___**FLAG**___**RESET**___**ON**___**FORK** flag. Linux-specific, supported since
           2.6.31.

       Each thread has a _reset-on-fork_ scheduling flag. When this flag is set, children created by
       [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown) 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)](https://www.chedong.com/phpMan.php/man/fork/2/markdown).

       More precisely, if the _reset-on-fork_ flag is set, the following rules apply for subsequently
       created children:

       •   If the calling thread has a scheduling policy of **SCHED**___**FIFO** or **SCHED**___**RR**, the policy is
           reset to **SCHED**___**OTHER** in child processes.

       •   If the calling process has a negative nice value, the nice value is reset to zero in
           child processes.

## OPTIONS
### -a --all-tasks
           Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID.

### -m --max
           Show minimum and maximum valid priorities, then exit.

### -p --pid
           Operate on an existing PID and do not launch a new task.

### -v --verbose
           Show status information.

### -V --version
           Display version information and exit.

### -h --help
           Display help text and exit.

## USAGE
       The default behavior is to run a new command:
           **chrt** _priority_ _command_ [_arguments_]

       You can also retrieve the real-time attributes of an existing task:
           **chrt** **-p** _PID_

       Or set them:
           **chrt** **-r** **-p** _priority_ _PID_

## PERMISSIONS
       A user must possess **CAP**___**SYS**___**NICE** to change the scheduling attributes of a process. Any user
       can retrieve the scheduling information.

## NOTES
       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.

       Linux' default scheduling policy is **SCHED**___**OTHER**.

## AUTHORS
       Robert Love <<rml@tech9.net>>, Karel Zak <<kzak@redhat.com>>

## SEE ALSO
       [**nice**(1)](https://www.chedong.com/phpMan.php/man/nice/1/markdown), [**renice**(1)](https://www.chedong.com/phpMan.php/man/renice/1/markdown), [**taskset**(1)](https://www.chedong.com/phpMan.php/man/taskset/1/markdown), [**sched**(7)](https://www.chedong.com/phpMan.php/man/sched/7/markdown)

       See **sched**___**[setscheduler**(2)](https://www.chedong.com/phpMan.php/man/setscheduler/2/markdown) for a description of the Linux scheduling scheme.

## REPORTING BUGS
       For bug reports, use the issue tracker at <https://github.com/karelzak/util-linux/issues>.

## AVAILABILITY
       The **chrt** command is part of the util-linux package which can be downloaded from Linux Kernel
       Archive <<https://www.kernel.org/pub/linux/utils/util-linux/>>.



util-linux 2.37.2                            2021-06-02                                      [CHRT(1)](https://www.chedong.com/phpMan.php/man/CHRT/1/markdown)
