NetBSD/usr.sbin/psrset/psrset.8

123 lines
3.6 KiB
Groff

.\" $NetBSD: psrset.8,v 1.6 2020/01/09 15:50:16 ad Exp $
.\"
.\" Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" 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 January 9, 2020
.Dt PSRSET 8
.Os
.Sh NAME
.Nm psrset
.Nd control processor sets
.Sh SYNOPSIS
.Nm
.Op Ar setid ...
.Nm
.Fl a Ar setid Ar cpuid Ar ...
.Nm
.Fl b Ar setid Ar pid Ar ...
.Nm
.Fl c Op Ar cpuid Ar ...
.Nm
.Fl d Ar setid
.Nm
.Fl e Ar setid Ar command
.Nm
.Fl i Op Ar setid ...
.Nm
.Fl p
.Nm
.Fl r Ar cpuid Ar ...
.Nm
.Fl u Ar pid Ar ...
.Sh DESCRIPTION
The
.Nm
command can be used to control and inspect processor sets.
.Pp
The system always contains at least one processor set: the default
set.
The default set must contain at least one online processor (CPU) at
all times.
.Pp
Where the system has symmetric multithreading (SMT), is is recommended that
CPUs representing different threads within a single core are not assigned to
different processor sets.
.Pp
Available options:
.Bl -tag -width indent
.It Fl a
Assign one or more processors (CPUs) to the set
.Ar setid .
In the current implementation, a CPU may only be present in one set.
CPU IDs are as reported and used by the
.Xr cpuctl 8
command.
.It Fl b
Bind one or more processes to the set
.Ar setid .
All LWPs within the processes will be affected.
Bindings are inherited when new LWPs or processes are forked.
However, setting a new binding on a parent process does not affect the
bindings of its existing child processes.
.It Fl c
Create a new processor set.
If successful, the ID of the new set will be printed.
If a list of CPU IDs is provided, those CPUs will be assigned to the set
upon creation.
Otherwise, the set will be created empty.
.It Fl d
Delete the processor set specified by
.Ar setid .
Any LWPs bound to the set will be re-bound to the default processor set.
.It Fl e
Execute a command within the processor set specified by
.Ar setid .
.It Fl i
List all processor sets.
For each set, print the member CPUs.
If
.Nm
is run without any options, it behaves as if
.Fl i
were given.
.It Fl p
List all CPUs.
For each CPU, print the associated processor set.
.It Fl r
Remove a CPU from its current set, and return it back to the default
processor set.
.It Fl u
Bind the specified processes to the system default processor set.
.El
.Sh SEE ALSO
.Xr pset 3 ,
.Xr cpuctl 8 ,
.Xr schedctl 8
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 5.0 .