File: coresched.1.adoc

package info (click to toggle)
util-linux 2.41-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 95,208 kB
  • sloc: ansic: 179,016; sh: 22,689; yacc: 1,284; makefile: 528; xml: 422; python: 316; lex: 89; ruby: 75; csh: 37; exp: 19; sed: 16; perl: 15; sql: 9
file content (135 lines) | stat: -rw-r--r-- 4,284 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//po4a: entry man manual
////
coresched(1) manpage
////
= coresched(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: coresched
:colon: :
:copyright: ©

== NAME

coresched - manage core scheduling cookies for tasks

== SYNOPSIS

*{command}* [*get*] [*-s* _pid_]

*{command}* *new* [*-t* _type_] *-d* _pid_

*{command}* *new* [*-t* _type_] \-- _command_ [_argument_...]

*{command}* *copy* [*-s* _pid_] [*-t* _type_] *-d* _pid_

*{command}* *copy* [*-s* _pid_] [*-t* _type_] \-- _command_ [_argument_...]

== DESCRIPTION
The *{command}* 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*::
Retrieve the core scheduling cookie of the PID specified in *-s*.
If *-s* is omitted, it will get the cookie of the current *{command}* process.

*new*::
Assign a new cookie to an existing PID specified in *-d*, or execute _command_ with a new cookie.

*copy*::
Copy the cookie from an existing PID (*-s*) to another PID (*-d*), or execute _command_ with that cookie.
If *-s* is omitted, it will get the cookie of the current *{command}* process.

If no function is specified, it will run the *get* function.

== OPTIONS
*-s*, *--source* _PID_::
Which _PID_ to get the cookie from.
If this option is omitted, it will get the cookie from the current *{command}* process.

*-d*, *--dest* _PID_::
Which _PID_ to modify the cookie of.

*-t*, *--dest-type* _TYPE_::
The type of the PID whose cookie will be modified. This 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.

include::man-common/help-version.adoc[]

== EXAMPLES
Get the core scheduling cookie of the {command} task itself, usually inherited from its parent{colon}::
*{command} get*

Get the core scheduling cookie of a task with PID _123_{colon}::
*{command} get -s* _123_

Give a task with PID _123_ a new core scheduling cookie{colon}::
*{command} new -d* _123_

Spawn a new task with a new core scheduling cookie{colon}::
*{command} new* \-- _command_ [_argument_...]

Copy the cookie from the current {command} process another task with pid _456_{colon}::
*{command} copy -d* _456_

Copy the cookie from a task with pid _123_ to another task with pid _456_{colon}::
*{command} copy -s* _123_ *-d* _456_

Copy the cookie from a task with pid _123_ to a new task _command_{colon}::
*{command} copy -s* _123_ \-- _command_ [_argument_...]

Copy the cookie from a task with pid _123_ to the process group ID _456_{colon}::
*{command} copy -s* _123_ *-t* _pgid_ *-d* _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, *{command}* returns 0.
If *{command}* fails, it will print an error and return 1.

If a _command_ is being executed, the return value of *{command}* will be the return value of _command_.

== NOTES
*{command}* requires core scheduling support in the kernel.
This can be enabled via the *CONFIG_SCHED_CORE* kernel config option.

== AUTHORS
mailto:thijs@raymakers.nl[Thijs Raymakers],
mailto:pauld@redhat.com[Phil Auld]

== COPYRIGHT

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_

include::man-common/bugreports.adoc[]

include::man-common/footer.adoc[]

ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]