CORESCHED(1)

๐Ÿ’– CORESCHED ๐Ÿ’–

okay bestie, welcome to coresched โ€” the User Commands girlie whose whole entire job is managing core scheduling cookies for tasks. yes it's real, yes it's a whole vibe, let's get into it ๐Ÿชโœจ


๐ŸŒธ 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 ๐Ÿฆ‹

So. The coresched command is literally here to retrieve or modify the core scheduling cookies of a running process โ€” you give it a pid, it does its thing. Or! It can spawn a brand new command with core scheduling cookies already attached. main character entrance fr fr ๐Ÿ’…

Now what even is core scheduling, you ask? Okay so: it permits the definition of groups of tasks that are allowed to share a physical core. How? By assigning a cookie to each task. And the rule is โ€” only tasks that have the same cookie are allowed to be scheduled on the same physical core. no cookie match, no sharing, periodt.

Two options for the cookie situation:

  • assign a new random cookie to a task, OR
  • copy a cookie from another task.

And that's it. It is not possible to choose the value of the cookie. nope. not yours to pick. the kernel decides, you just vibe ๐Ÿ˜Œ


๐ŸŽ€ FUNCTIONS ๐ŸŽ€

get

Retrieve the core scheduling cookie of the PID you put in -s. And if you just... don't include -s? It'll get the cookie of the current coresched process itself. self-love honestly ๐Ÿซถ

new

Assign a new cookie to an existing PID specified in -d, or execute command with a new cookie. fresh start energy โœจ

copy

Copy the cookie from an existing PID (-s) to another PID (-d), or execute command with that cookie. And if -s is omitted? It gets the cookie of the current coresched process. again. self-copy, iconic ๐ŸŽ€

Also: if you specify no function at all, it will just run the get function. default behaviour, no notes ๐Ÿ’…

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -s, --source PID โ€” which PID to get the cookie from. If this option is omitted, it will get the cookie from the current coresched process. (yes, again. it's a theme.)
  • -d, --dest PID โ€” which PID to modify the cookie of. this is the glow-up target ๐ŸŒˆ
  • -t, --dest-type TYPE โ€” the type of the PID whose cookie will be modified. And it can be one of three values:
    • pid, or process ID
    • tgid, or thread group ID (default value) โญ
    • pgid, or process group ID
  • -v, --verbose โ€” show extra information when modifying cookies of tasks. the girlies love a little extra detail ๐Ÿ’œ
  • -h, --help โ€” display help text and exit. we love a quick escape ๐Ÿ™ˆ
  • -V, --version โ€” display version and exit.

๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

Get the core scheduling cookie of the coresched task itself, usually inherited from its parent:

coresched get

Get the core scheduling cookie of a task with PID 123:

coresched get -s 123

Give a task with PID 123 a new core scheduling cookie:

coresched new -d 123

Spawn a new task with a new core scheduling cookie:

coresched new -- command [argument...]

Copy the cookie from the current coresched process to another task with pid 456:

coresched copy -d 456

Copy the cookie from a task with pid 123 to another task with pid 456:

coresched copy -s 123 -d 456

Copy the cookie from a task with pid 123 to a new task command:

coresched copy -s 123 -- command [argument...]

Copy the cookie from a task with pid 123 to the process group ID 456:

coresched copy -s 123 -t pgid -d 456

๐Ÿงš PERMISSIONS ๐Ÿงš

Okay so this part is not optional, bestie. Retrieving or modifying the core scheduling cookie of a process requires PTRACE_MODE_READ_REALCREDS ptrace access to that process. And for the full lore on that, see the section "Ptrace access mode checking" in ptrace(2). iykyk ๐Ÿ˜ญ


โญ EXIT STATUS โญ

On success, coresched returns 0. If coresched fails, it will print an error and return 1. no cap.

But โ€” if a command is being executed, the return value of coresched will be the return value of command. so like. the command is the one holding the mic at that point ๐ŸŽค


๐Ÿ’€ NOTES ๐Ÿ’€

coresched requires core scheduling support in the kernel. This can be enabled via the CONFIG_SCHED_CORE kernel config option. no kernel support, no cookies, no slay. period.


๐Ÿ’œ AUTHORS ๐Ÿ’œ

Thijs Raymakers <thijs@raymakers.nl>, Phil Auld <pauld@redhat.com>

the icons who built this. we thank them ๐Ÿซถ


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)

Also โ€” 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>.

please actually report them and not just complain in the group chat bestie, i'm begging ๐Ÿ™ˆ


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

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


and that's the whole page, angel ๐Ÿ’– this was util-linux 2.42.4, dated 2026-09-21, and yes that date is lowkey in the future, we don't ask questions, we just say slay. go forth and sort your cookies ๐Ÿช๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms