mirror of https://github.com/mkerrisk/man-pages
sched.7: Relocate discussion of group scheduling
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
7ef1473742
commit
4fbe161bf2
124
man7/sched.7
124
man7/sched.7
|
@ -438,52 +438,9 @@ resource limit can be used to define a limit to which
|
||||||
an unprivileged process's nice value can be raised; see
|
an unprivileged process's nice value can be raised; see
|
||||||
.BR setrlimit (2)
|
.BR setrlimit (2)
|
||||||
for details.
|
for details.
|
||||||
.\"
|
|
||||||
.SS The nice value and group scheduling
|
For further details on the nice value, see the subsections on
|
||||||
When scheduling non-real-time processes (i.e., those scheduled under the
|
the autogroup feature and group scheduling, below.
|
||||||
.BR SCHED_OTHER ,
|
|
||||||
.BR SCHED_BATCH ,
|
|
||||||
and
|
|
||||||
.BR SCHED_IDLE
|
|
||||||
policies), the CFS scheduler employs a technique known as "group scheduling",
|
|
||||||
if the kernel was configured with the
|
|
||||||
.BR CONFIG_GROUP_SCHED
|
|
||||||
option (which is typical).
|
|
||||||
Scheduling groups (also known as task groups)
|
|
||||||
are formed in the following circumstances:
|
|
||||||
.IP * 3
|
|
||||||
All of the processes in a non-root CPU cgroup form a scheduling group.
|
|
||||||
Thus, each non-root CPU cgroup is a scheduling group.
|
|
||||||
.IP *
|
|
||||||
All of the processes that are (implicitly) placed in an autogroup
|
|
||||||
(i.e., the same session, as created by
|
|
||||||
.BR setsid (2))
|
|
||||||
form a scheduling group.
|
|
||||||
Each new autogroup is thus a separate scheduling group.
|
|
||||||
.IP *
|
|
||||||
If autogrouping is disabled, then all processes in the root CPU cgroup
|
|
||||||
form a scheduling group (sometimes called the "root task group").
|
|
||||||
.PP
|
|
||||||
Under group scheduling,
|
|
||||||
the nice value has an effect for scheduling decisions
|
|
||||||
.IR "only relative to other threads in the same group" .
|
|
||||||
This has some surprising consequences in terms of the traditional semantics
|
|
||||||
of the nice value on UNIX systems.
|
|
||||||
In particular, if autogrouping
|
|
||||||
is enabled (which is the default), then employing
|
|
||||||
.BR setpriority (2)
|
|
||||||
or
|
|
||||||
.BR nice (1)
|
|
||||||
on a process has an effect only for scheduling relative
|
|
||||||
to other processes executed in the same session
|
|
||||||
(typically: the same terminal window).
|
|
||||||
Conversely, for two process that are (for example) the sole CPU-bound processes
|
|
||||||
in different sessions (different terminal windows),
|
|
||||||
.IR "modifying the nice value of the process in one of the sessions"
|
|
||||||
.IR "has no effect"
|
|
||||||
in terms of the scheduler's decisions relative to the
|
|
||||||
process in the other session.
|
|
||||||
.\" More succinctly: the nice(1) command is nearly a no-op since Linux 2.6.38.
|
|
||||||
.\"
|
.\"
|
||||||
.SS SCHED_BATCH: Scheduling batch processes
|
.SS SCHED_BATCH: Scheduling batch processes
|
||||||
(Since Linux 2.6.16.)
|
(Since Linux 2.6.16.)
|
||||||
|
@ -849,21 +806,53 @@ and
|
||||||
It does not group processes scheduled under real-time and
|
It does not group processes scheduled under real-time and
|
||||||
deadline policies.
|
deadline policies.
|
||||||
Those processes are scheduled according to the rules described earlier.
|
Those processes are scheduled according to the rules described earlier.
|
||||||
.SH NOTES
|
.\"
|
||||||
The
|
.SS The nice value and group scheduling
|
||||||
.BR cgroups (7)
|
When scheduling non-real-time processes (i.e., those scheduled under the
|
||||||
CPU controller can be used to limit the CPU consumption of
|
.BR SCHED_OTHER ,
|
||||||
groups of processes.
|
.BR SCHED_BATCH ,
|
||||||
|
and
|
||||||
|
.BR SCHED_IDLE
|
||||||
|
policies), the CFS scheduler employs a technique known as "group scheduling",
|
||||||
|
if the kernel was configured with the
|
||||||
|
.BR CONFIG_GROUP_SCHED
|
||||||
|
option (which is typical).
|
||||||
|
Scheduling groups (also known as task groups)
|
||||||
|
are formed in the following circumstances:
|
||||||
|
.IP * 3
|
||||||
|
All of the processes in a non-root CPU cgroup form a scheduling group.
|
||||||
|
Thus, each non-root CPU cgroup is a scheduling group.
|
||||||
|
.IP *
|
||||||
|
All of the processes that are (implicitly) placed in an autogroup
|
||||||
|
(i.e., the same session, as created by
|
||||||
|
.BR setsid (2))
|
||||||
|
form a scheduling group.
|
||||||
|
Each new autogroup is thus a separate scheduling group.
|
||||||
|
.IP *
|
||||||
|
If autogrouping is disabled, then all processes in the root CPU cgroup
|
||||||
|
form a scheduling group (sometimes called the "root task group").
|
||||||
.PP
|
.PP
|
||||||
Originally, Standard Linux was intended as a general-purpose operating
|
Under group scheduling,
|
||||||
system being able to handle background processes, interactive
|
the nice value has an effect for scheduling decisions
|
||||||
applications, and less demanding real-time applications (applications that
|
.IR "only relative to other threads in the same group" .
|
||||||
need to usually meet timing deadlines).
|
This has some surprising consequences in terms of the traditional semantics
|
||||||
Although the Linux kernel 2.6
|
of the nice value on UNIX systems.
|
||||||
allowed for kernel preemption and the newly introduced O(1) scheduler
|
In particular, if autogrouping
|
||||||
ensures that the time needed to schedule is fixed and deterministic
|
is enabled (which is the default), then employing
|
||||||
irrespective of the number of active tasks, true real-time computing
|
.BR setpriority (2)
|
||||||
was not possible up to kernel version 2.6.17.
|
or
|
||||||
|
.BR nice (1)
|
||||||
|
on a process has an effect only for scheduling relative
|
||||||
|
to other processes executed in the same session
|
||||||
|
(typically: the same terminal window).
|
||||||
|
Conversely, for two process that are (for example) the sole CPU-bound processes
|
||||||
|
in different sessions (different terminal windows),
|
||||||
|
.IR "modifying the nice value of the process in one of the sessions"
|
||||||
|
.IR "has no effect"
|
||||||
|
in terms of the scheduler's decisions relative to the
|
||||||
|
process in the other session.
|
||||||
|
.\" More succinctly: the nice(1) command is nearly a no-op since Linux 2.6.38.
|
||||||
|
.\"
|
||||||
.SS Real-time features in the mainline Linux kernel
|
.SS Real-time features in the mainline Linux kernel
|
||||||
.\" FIXME . Probably this text will need some minor tweaking
|
.\" FIXME . Probably this text will need some minor tweaking
|
||||||
.\" ask Carsten Emde about this.
|
.\" ask Carsten Emde about this.
|
||||||
|
@ -904,6 +893,21 @@ If this is selected, Linux is transformed into a regular
|
||||||
real-time operating system.
|
real-time operating system.
|
||||||
The FIFO and RR scheduling policies are then used to run a thread
|
The FIFO and RR scheduling policies are then used to run a thread
|
||||||
with true real-time priority and a minimum worst-case scheduling latency.
|
with true real-time priority and a minimum worst-case scheduling latency.
|
||||||
|
.SH NOTES
|
||||||
|
The
|
||||||
|
.BR cgroups (7)
|
||||||
|
CPU controller can be used to limit the CPU consumption of
|
||||||
|
groups of processes.
|
||||||
|
.PP
|
||||||
|
Originally, Standard Linux was intended as a general-purpose operating
|
||||||
|
system being able to handle background processes, interactive
|
||||||
|
applications, and less demanding real-time applications (applications that
|
||||||
|
need to usually meet timing deadlines).
|
||||||
|
Although the Linux kernel 2.6
|
||||||
|
allowed for kernel preemption and the newly introduced O(1) scheduler
|
||||||
|
ensures that the time needed to schedule is fixed and deterministic
|
||||||
|
irrespective of the number of active tasks, true real-time computing
|
||||||
|
was not possible up to kernel version 2.6.17.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.ad l
|
.ad l
|
||||||
.nh
|
.nh
|
||||||
|
|
Loading…
Reference in New Issue