CORESCHED(1) | User Commands | CORESCHED(1) |
NAME
coresched - manage core scheduling cookies for tasks
SYNOPSIS
coresched [get] [-s pid]
coresched new [-t type] -d pid
coresched new [-t type] -- command [argument...]
coresched copy [-s pid] [-t type] -d pid
coresched copy [-s pid] [-t type] -- command [argument...]
DESCRIPTION
The coresched command is used to retrieve or modify the core scheduling cookies of a running process given its pid, or to spawn a new command with core scheduling cookies.
Core scheduling permits the definition of groups of tasks that are allowed to share a physical core. This is done by assigning a cookie to each task. Only tasks have the same cookie are allowed to be scheduled on the same physical core.
It is possible to either assign a new random cookie to a task, or copy a cookie from another task. It is not possible to choose the value of the cookie.
FUNCTIONS
get
new
copy
If no function is specified, it will run the get function.
OPTIONS
-s, --source PID
-d, --dest PID
-t, --dest-type TYPE
-v, --verbose
-h, --help
-V, --version
EXAMPLES
Get the core scheduling cookie of the coresched task itself, usually inherited from its parent:
Get the core scheduling cookie of a task with PID 123:
Give a task with PID 123 a new core scheduling cookie:
Spawn a new task with a new core scheduling cookie:
Copy the cookie from the current coresched process another task with pid 456:
Copy the cookie from a task with pid 123 to another task with pid 456:
Copy the cookie from a task with pid 123 to a new task command:
Copy the cookie from a task with pid 123 to the process group ID 456:
PERMISSIONS
Retrieving or modifying the core scheduling cookie of a process requires PTRACE_MODE_READ_REALCREDS ptrace access to that process. See the section "Ptrace access mode checking" in ptrace(2) for more information.
RETURN VALUE
On success, coresched returns 0. If coresched fails, it will print an error and return 1.
If a command is being executed, the return value of coresched will be the return value of command.
NOTES
coresched requires core scheduling support in the kernel. This can be enabled via the CONFIG_SCHED_CORE kernel config option.
AUTHORS
Thijs Raymakers <thijs@raymakers.nl>, Phil Auld <pauld@redhat.com>
COPYRIGHT
Copyright © 2024 Thijs Raymakers and Phil Auld. This is free software licensed under the EUPL.
SEE ALSO
chrt(1), nice(1), renice(1), taskset(1), ptrace(2), sched(7)
The Linux kernel source files Documentation/admin-guide/hw-vuln/core-scheduling.rst
REPORTING BUGS
For bug reports, use the issue tracker https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The coresched 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/.
2025-03-29 | util-linux 2.41 |