1.\" $NetBSD: psrset.8,v 1.6 2020/01/09 15:50:16 ad Exp $ 2.\" 3.\" Copyright (c) 2008, 2020 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25.\" POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd January 9, 2020 28.Dt PSRSET 8 29.Os 30.Sh NAME 31.Nm psrset 32.Nd control processor sets 33.Sh SYNOPSIS 34.Nm 35.Op Ar setid ... 36.Nm 37.Fl a Ar setid Ar cpuid Ar ... 38.Nm 39.Fl b Ar setid Ar pid Ar ... 40.Nm 41.Fl c Op Ar cpuid Ar ... 42.Nm 43.Fl d Ar setid 44.Nm 45.Fl e Ar setid Ar command 46.Nm 47.Fl i Op Ar setid ... 48.Nm 49.Fl p 50.Nm 51.Fl r Ar cpuid Ar ... 52.Nm 53.Fl u Ar pid Ar ... 54.Sh DESCRIPTION 55The 56.Nm 57command can be used to control and inspect processor sets. 58.Pp 59The system always contains at least one processor set: the default 60set. 61The default set must contain at least one online processor (CPU) at 62all times. 63.Pp 64Where the system has symmetric multithreading (SMT), is is recommended that 65CPUs representing different threads within a single core are not assigned to 66different processor sets. 67.Pp 68Available options: 69.Bl -tag -width indent 70.It Fl a 71Assign one or more processors (CPUs) to the set 72.Ar setid . 73In the current implementation, a CPU may only be present in one set. 74CPU IDs are as reported and used by the 75.Xr cpuctl 8 76command. 77.It Fl b 78Bind one or more processes to the set 79.Ar setid . 80All LWPs within the processes will be affected. 81Bindings are inherited when new LWPs or processes are forked. 82However, setting a new binding on a parent process does not affect the 83bindings of its existing child processes. 84.It Fl c 85Create a new processor set. 86If successful, the ID of the new set will be printed. 87If a list of CPU IDs is provided, those CPUs will be assigned to the set 88upon creation. 89Otherwise, the set will be created empty. 90.It Fl d 91Delete the processor set specified by 92.Ar setid . 93Any LWPs bound to the set will be re-bound to the default processor set. 94.It Fl e 95Execute a command within the processor set specified by 96.Ar setid . 97.It Fl i 98List all processor sets. 99For each set, print the member CPUs. 100If 101.Nm 102is run without any options, it behaves as if 103.Fl i 104were given. 105.It Fl p 106List all CPUs. 107For each CPU, print the associated processor set. 108.It Fl r 109Remove a CPU from its current set, and return it back to the default 110processor set. 111.It Fl u 112Bind the specified processes to the system default processor set. 113.El 114.Sh SEE ALSO 115.Xr pset 3 , 116.Xr cpuctl 8 , 117.Xr schedctl 8 118.Sh HISTORY 119The 120.Nm 121command first appeared in 122.Nx 5.0 . 123