zpool(8) uses tbl.
[netbsd-mini2440.git] / usr.sbin / schedctl / schedctl.8
blobc6a87fb37e73d5204abaebee50d021de0b0e851d
1 .\"     $NetBSD: schedctl.8,v 1.8 2008/06/22 14:51:45 wiz Exp $
2 .\"
3 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Mindaugas Rasiukevicius <rmind at NetBSD org>.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .Dd October 18, 2008
31 .Dt SCHEDCTL 8
32 .Os
33 .Sh NAME
34 .Nm schedctl
35 .Nd control scheduling of processes and threads
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl A Ar cpus
39 .Op Fl C Ar class
40 .Op Fl P Ar pri
41 .Op Fl t Ar lid
42 .Fl p Ar pid | Ar command
43 .Sh DESCRIPTION
44 The
45 .Nm
46 command can be used to control the scheduling of processes and threads.
47 It also returns information about the current scheduling parameters
48 of the process or thread.
49 Only the super-user may change the scheduling parameters.
50 .Nm
51 can also be used to start a new command using the specified parameters.
52 .Pp
53 Available options:
54 .Bl -tag -width indent
55 .It Fl A Ar cpus
56 Set of the processors on which process or thread should run, that
57 is, affinity.
58 Processors are defined as numbers (starting from zero) and separated
59 by commas.
60 A value of \-1 is used to unset the affinity.
61 .It Fl C Ar class
62 Scheduling class (policy), one of:
63 .Bl -tag -width SCHEDOTHERXX
64 .It Dv SCHED_OTHER
65 Time-sharing (TS) scheduling policy.
66 The default policy in
67 .Nx .
68 .It Dv SCHED_FIFO
69 First in, first out (FIFO) scheduling policy.
70 .It Dv SCHED_RR
71 Round-robin scheduling policy.
72 .El
73 .It Fl P Ar pri
74 Priority for the process or thread.
75 Value should be in the range from
76 .Dv SCHED_PRI_MIN
77 (0) to
78 .Dv SCHED_PRI_MAX
79 (63).
80 Setting of priority for the process or thread running at
81 .Dv SCHED_OTHER
82 policy is not allowed.
83 .It Fl p Ar pid
84 The target process which will be affected.
85 If the process has more than one thread, all of them will be affected.
86 .Pp
88 .Fl p
89 is not given, a command to execute must be given on the command line.
90 .It Fl t Ar lid
91 Thread in the specified process.
92 If specified, only this thread in the process will be affected.
93 May only be specified if
94 .Fl p
95 is also given.
96 .El
97 .Sh EXAMPLES
98 Show scheduling information about the process whose ID is
99 .Dq 123 :
100 .Bd -literal -offset indent
101 # schedctl -p 123
104 Set the affinity to CPU 0 and CPU 1, policy to
105 .Dv SCHED_RR ,
106 and priority to 63
107 for thread whose ID is
108 .Dq 1
109 in process whose ID is
110 .Dq 123 :
111 .Bd -literal -offset indent
112 # schedctl -p 123 -t 1 -A 0,1 -C SCHED_RR -P 63
115 Run the
116 .Xr top 1
117 command with real-time priority:
118 .Bd -literal -offset indent
119 # schedctl -C SCHED_FIFO top
121 .Sh SEE ALSO
122 .Xr nice 1 ,
123 .Xr getpriority 2 ,
124 .Xr setpriority 2 ,
125 .Xr psrset 8 ,
126 .Xr renice 8
127 .Sh HISTORY
130 command first appeared in
131 .Nx 5.0 .