{
    "content": [
        {
            "type": "text",
            "text": "# chrt(1) (man)\n\n## TLDR\n\n> Manipulate the real-time attributes of a process.\n\n- Display attributes of a process:\n  `chrt {{-p|--pid}} {{pid}}`\n- Display attributes of all threads of a process:\n  `chrt {{-a|--all-tasks}} {{-p|--pid}} {{pid}}`\n- Display the min/max priority values that can be used with `chrt`:\n  `chrt {{-m|--max}}`\n- Set the scheduling priority of a process:\n  `chrt {{-p|--pid}} {{priority}} {{pid}}`\n- Set the scheduling policy of a process:\n  `chrt --{{deadline|idle|batch|rr|fifo|other}} {{-p|--pid}} {{priority}} {{pid}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** chrt - manipulate the real-time attributes of a process\n\n**Synopsis:** chrt [options] priority command argument ...\nchrt [options] -p [priority] PID\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --all-tasks | — | Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID. |\n| -m | --max | — | Show minimum and maximum valid priorities, then exit. |\n| -p | --pid | — | Operate on an existing PID and do not launch a new task. |\n| -v | --verbose | — | Show status information. |\n| -V | --version | — | Display version information and exit. |\n| -h | --help | — | Display help text and exit. |\n\n## See Also\n\n- nice(1)\n- renice(1)\n- taskset(1)\n- sched(7)\n- schedsetscheduler(2)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (3 lines)\n- **POLICIES** (1 lines) — 6 subsections\n  - -o --other (3 lines)\n  - -f --fifo (2 lines)\n  - -r --rr (3 lines)\n  - -b --batch (3 lines)\n  - -i --idle (3 lines)\n  - -d --deadline (8 lines)\n- **SCHEDULING OPTIONS** (1 lines) — 4 subsections\n  - -T --sched-runtime (2 lines)\n  - -P --sched-period (2 lines)\n  - -D --sched-deadline (2 lines)\n  - -R --reset-on-fork (17 lines)\n- **OPTIONS** (1 lines) — 6 subsections\n  - -a --all-tasks (2 lines)\n  - -m --max (2 lines)\n  - -p --pid (2 lines)\n  - -v --verbose (2 lines)\n  - -V --version (2 lines)\n  - -h --help (2 lines)\n- **USAGE** (9 lines)\n- **PERMISSIONS** (3 lines)\n- **NOTES** (5 lines)\n- **AUTHORS** (2 lines)\n- **SEE ALSO** (4 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nchrt - manipulate the real-time attributes of a process\n\n### SYNOPSIS\n\nchrt [options] priority command argument ...\n\nchrt [options] -p [priority] PID\n\n### DESCRIPTION\n\nchrt sets or retrieves the real-time scheduling attributes of an existing PID, or runs\ncommand with the given attributes.\n\n### POLICIES\n\n#### -o --other\n\nSet scheduling policy to SCHEDOTHER (time-sharing scheduling). This is the default Linux\nscheduling policy.\n\n#### -f --fifo\n\nSet scheduling policy to SCHEDFIFO (first in-first out).\n\n#### -r --rr\n\nSet scheduling policy to SCHEDRR (round-robin scheduling). When no policy is defined,\nthe SCHEDRR is used as the default.\n\n#### -b --batch\n\nSet scheduling policy to SCHEDBATCH (scheduling batch processes). Linux-specific,\nsupported since 2.6.16. The priority argument has to be set to zero.\n\n#### -i --idle\n\nSet scheduling policy to SCHEDIDLE (scheduling very low priority jobs). Linux-specific,\nsupported since 2.6.23. The priority argument has to be set to zero.\n\n#### -d --deadline\n\nSet scheduling policy to SCHEDDEADLINE (sporadic task model deadline scheduling).\nLinux-specific, supported since 3.14. The priority argument has to be set to zero. See\nalso --sched-runtime, --sched-deadline and --sched-period. The relation between the\noptions required by the kernel is runtime ⇐ deadline ⇐ period. chrt copies period to\ndeadline if --sched-deadline is not specified and deadline to runtime if --sched-runtime\nis not specified. It means that at least --sched-period has to be specified. See sched(7)\nfor more details.\n\n### SCHEDULING OPTIONS\n\n#### -T --sched-runtime\n\nSpecifies runtime parameter for SCHEDDEADLINE policy (Linux-specific).\n\n#### -P --sched-period\n\nSpecifies period parameter for SCHEDDEADLINE policy (Linux-specific).\n\n#### -D --sched-deadline\n\nSpecifies deadline parameter for SCHEDDEADLINE policy (Linux-specific).\n\n#### -R --reset-on-fork\n\nUse SCHEDRESETONFORK or SCHEDFLAGRESETONFORK flag. Linux-specific, supported since\n2.6.31.\n\nEach thread has a reset-on-fork scheduling flag. When this flag is set, children created by\nfork(2) do not inherit privileged scheduling policies. After the reset-on-fork flag has been\nenabled, it can be reset only if the thread has the CAPSYSNICE capability. This flag is\ndisabled in child processes created by fork(2).\n\nMore precisely, if the reset-on-fork flag is set, the following rules apply for subsequently\ncreated children:\n\n•   If the calling thread has a scheduling policy of SCHEDFIFO or SCHEDRR, the policy is\nreset to SCHEDOTHER in child processes.\n\n•   If the calling process has a negative nice value, the nice value is reset to zero in\nchild processes.\n\n### OPTIONS\n\n#### -a --all-tasks\n\nSet or retrieve the scheduling attributes of all the tasks (threads) for a given PID.\n\n#### -m --max\n\nShow minimum and maximum valid priorities, then exit.\n\n#### -p --pid\n\nOperate on an existing PID and do not launch a new task.\n\n#### -v --verbose\n\nShow status information.\n\n#### -V --version\n\nDisplay version information and exit.\n\n#### -h --help\n\nDisplay help text and exit.\n\n### USAGE\n\nThe default behavior is to run a new command:\nchrt priority command [arguments]\n\nYou can also retrieve the real-time attributes of an existing task:\nchrt -p PID\n\nOr set them:\nchrt -r -p priority PID\n\n### PERMISSIONS\n\nA user must possess CAPSYSNICE to change the scheduling attributes of a process. Any user\ncan retrieve the scheduling information.\n\n### NOTES\n\nOnly SCHEDFIFO, SCHEDOTHER and SCHEDRR are part of POSIX 1003.1b Process Scheduling. The\nother scheduling attributes may be ignored on some systems.\n\nLinux' default scheduling policy is SCHEDOTHER.\n\n### AUTHORS\n\nRobert Love <rml@tech9.net>, Karel Zak <kzak@redhat.com>\n\n### SEE ALSO\n\nnice(1), renice(1), taskset(1), sched(7)\n\nSee schedsetscheduler(2) for a description of the Linux scheduling scheme.\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe chrt command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                      CHRT(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "chrt",
        "section": "1",
        "mode": "man",
        "summary": "chrt - manipulate the real-time attributes of a process",
        "synopsis": "chrt [options] priority command argument ...\nchrt [options] -p [priority] PID",
        "tldr_summary": "Manipulate the real-time attributes of a process.",
        "tldr_examples": [
            {
                "description": "Display attributes of a process",
                "command": "chrt {{-p|--pid}} {{pid}}"
            },
            {
                "description": "Display attributes of all threads of a process",
                "command": "chrt {{-a|--all-tasks}} {{-p|--pid}} {{pid}}"
            },
            {
                "description": "Display the min/max priority values that can be used with `chrt`",
                "command": "chrt {{-m|--max}}"
            },
            {
                "description": "Set the scheduling priority of a process",
                "command": "chrt {{-p|--pid}} {{priority}} {{pid}}"
            },
            {
                "description": "Set the scheduling policy of a process",
                "command": "chrt --{{deadline|idle|batch|rr|fifo|other}} {{-p|--pid}} {{priority}} {{pid}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--all-tasks",
                "arg": null,
                "description": "Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID."
            },
            {
                "flag": "-m",
                "long": "--max",
                "arg": null,
                "description": "Show minimum and maximum valid priorities, then exit."
            },
            {
                "flag": "-p",
                "long": "--pid",
                "arg": null,
                "description": "Operate on an existing PID and do not launch a new task."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Show status information."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "nice",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/nice/1/json"
            },
            {
                "name": "renice",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/renice/1/json"
            },
            {
                "name": "taskset",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/taskset/1/json"
            },
            {
                "name": "sched",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/sched/7/json"
            },
            {
                "name": "schedsetscheduler",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/schedsetscheduler/2/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "POLICIES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-o --other",
                        "lines": 3,
                        "flag": "-o",
                        "long": "--other"
                    },
                    {
                        "name": "-f --fifo",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--fifo"
                    },
                    {
                        "name": "-r --rr",
                        "lines": 3,
                        "flag": "-r",
                        "long": "--rr"
                    },
                    {
                        "name": "-b --batch",
                        "lines": 3,
                        "flag": "-b",
                        "long": "--batch"
                    },
                    {
                        "name": "-i --idle",
                        "lines": 3,
                        "flag": "-i",
                        "long": "--idle"
                    },
                    {
                        "name": "-d --deadline",
                        "lines": 8,
                        "flag": "-d",
                        "long": "--deadline"
                    }
                ]
            },
            {
                "name": "SCHEDULING OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-T --sched-runtime",
                        "lines": 2,
                        "flag": "-T",
                        "long": "--sched-runtime"
                    },
                    {
                        "name": "-P --sched-period",
                        "lines": 2,
                        "flag": "-P",
                        "long": "--sched-period"
                    },
                    {
                        "name": "-D --sched-deadline",
                        "lines": 2,
                        "flag": "-D",
                        "long": "--sched-deadline"
                    },
                    {
                        "name": "-R --reset-on-fork",
                        "lines": 17,
                        "flag": "-R",
                        "long": "--reset-on-fork"
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --all-tasks",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--all-tasks"
                    },
                    {
                        "name": "-m --max",
                        "lines": 2,
                        "flag": "-m",
                        "long": "--max"
                    },
                    {
                        "name": "-p --pid",
                        "lines": 2,
                        "flag": "-p",
                        "long": "--pid"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "USAGE",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "PERMISSIONS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}