1 .\" $NetBSD: schedctl.8,v 1.8 2008/06/22 14:51:45 wiz Exp $
3 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Mindaugas Rasiukevicius <rmind at NetBSD org>.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
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.
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.
35 .Nd control scheduling of processes and threads
42 .Fl p Ar pid | Ar command
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.
51 can also be used to start a new command using the specified parameters.
54 .Bl -tag -width indent
56 Set of the processors on which process or thread should run, that
58 Processors are defined as numbers (starting from zero) and separated
60 A value of \-1 is used to unset the affinity.
62 Scheduling class (policy), one of:
63 .Bl -tag -width SCHEDOTHERXX
65 Time-sharing (TS) scheduling policy.
69 First in, first out (FIFO) scheduling policy.
71 Round-robin scheduling policy.
74 Priority for the process or thread.
75 Value should be in the range from
80 Setting of priority for the process or thread running at
82 policy is not allowed.
84 The target process which will be affected.
85 If the process has more than one thread, all of them will be affected.
89 is not given, a command to execute must be given on the command line.
91 Thread in the specified process.
92 If specified, only this thread in the process will be affected.
93 May only be specified if
98 Show scheduling information about the process whose ID is
100 .Bd -literal -offset indent
104 Set the affinity to CPU 0 and CPU 1, policy to
107 for thread whose ID is
109 in process whose ID is
111 .Bd -literal -offset indent
112 # schedctl -p 123 -t 1 -A 0,1 -C SCHED_RR -P 63
117 command with real-time priority:
118 .Bd -literal -offset indent
119 # schedctl -C SCHED_FIFO top
130 command first appeared in