132 lines
3.8 KiB
Groff
132 lines
3.8 KiB
Groff
.\" $NetBSD: schedctl.8,v 1.10 2011/03/21 15:35:21 jruoho Exp $
|
|
.\"
|
|
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
.\" by Mindaugas Rasiukevicius <rmind at NetBSD org>.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
.\"
|
|
.Dd March 21, 2011
|
|
.Dt SCHEDCTL 8
|
|
.Os
|
|
.Sh NAME
|
|
.Nm schedctl
|
|
.Nd control scheduling of processes and threads
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl A Ar cpus
|
|
.Op Fl C Ar class
|
|
.Op Fl P Ar pri
|
|
.Op Fl t Ar lid
|
|
.Fl p Ar pid | Ar command
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm
|
|
command can be used to control the scheduling of processes and threads.
|
|
It also returns information about the current scheduling parameters
|
|
of the process or thread.
|
|
Only the super-user may change the scheduling parameters.
|
|
.Nm
|
|
can also be used to start a new command using the specified parameters.
|
|
.Pp
|
|
Available options:
|
|
.Bl -tag -width "-C class "
|
|
.It Fl A Ar cpus
|
|
Set of the processors on which process or thread should run, that
|
|
is, affinity.
|
|
Processors are defined as numbers (starting from zero) and separated
|
|
by commas.
|
|
A value of \-1 is used to unset the affinity.
|
|
.It Fl C Ar class
|
|
Scheduling class (policy), one of:
|
|
.Bl -tag -width SCHEDOTHERXX
|
|
.It Dv SCHED_OTHER
|
|
Time-sharing (TS) scheduling policy.
|
|
The default policy in
|
|
.Nx .
|
|
.It Dv SCHED_FIFO
|
|
First in, first out (FIFO) scheduling policy.
|
|
.It Dv SCHED_RR
|
|
Round-robin scheduling policy.
|
|
.El
|
|
.It Fl P Ar pri
|
|
Priority for the process or thread.
|
|
Value should be in the range from
|
|
.Dv SCHED_PRI_MIN
|
|
(0) to
|
|
.Dv SCHED_PRI_MAX
|
|
(63).
|
|
Setting of priority for the process or thread running at
|
|
.Dv SCHED_OTHER
|
|
policy is not allowed.
|
|
.It Fl p Ar pid
|
|
The target process which will be affected.
|
|
If the process has more than one thread, all of them will be affected.
|
|
.Pp
|
|
If
|
|
.Fl p
|
|
is not given, a command to execute must be given on the command line.
|
|
.It Fl t Ar lid
|
|
Thread in the specified process.
|
|
If specified, only this thread in the process will be affected.
|
|
May only be specified if
|
|
.Fl p
|
|
is also given.
|
|
.El
|
|
.Sh EXAMPLES
|
|
Show scheduling information about the process whose ID is
|
|
.Dq 123 :
|
|
.Bd -literal -offset indent
|
|
# schedctl -p 123
|
|
.Ed
|
|
.Pp
|
|
Set the affinity to CPU 0 and CPU 1, policy to
|
|
.Dv SCHED_RR ,
|
|
and priority to 63
|
|
for thread whose ID is
|
|
.Dq 1
|
|
in process whose ID is
|
|
.Dq 123 :
|
|
.Bd -literal -offset indent
|
|
# schedctl -p 123 -t 1 -A 0,1 -C SCHED_RR -P 63
|
|
.Ed
|
|
.Pp
|
|
Run the
|
|
.Xr top 1
|
|
command with real-time priority:
|
|
.Bd -literal -offset indent
|
|
# schedctl -C SCHED_FIFO top
|
|
.Ed
|
|
.Sh SEE ALSO
|
|
.Xr nice 1 ,
|
|
.Xr getpriority 2 ,
|
|
.Xr setpriority 2 ,
|
|
.Xr psrset 8 ,
|
|
.Xr renice 8
|
|
.Sh HISTORY
|
|
The
|
|
.Nm
|
|
command first appeared in
|
|
.Nx 5.0 .
|