<commit_before>.\" Copyright (c) 2008 <NAME>
.\" Copyright (c) 2008 <NAME>
.\" 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 AUTHOR 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 AUTHOR 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.
.\"
.\" $FreeBSD$
.\"
.Dd November 29, 2008
.Dt CPUSET 1
.Os
.Sh NAME
.Nm cpuset
.Nd "configure processor sets"
.Sh SYNOPSIS
.Nm
.Op Fl l Ar cpu-list
.Op Fl s Ar setid
.Ar cmd
.Nm
.Op Fl l Ar cpu-list
.Op Fl s Ar setid
.Fl p Ar pid
.Nm
.Op Fl cr
.Op Fl l Ar cpu-list
.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq
.Nm
.Op Fl cgir
.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq
.Sh DESCRIPTION
The
.Nm
command can be used to assign processor sets to processes, run commands
constrained to a given set or list of processors, and query information
about processor binding, sets, and available processors in the system.
.Pp
.Nm
requires a target to modify or query.
The target may be specified as a command, process id, thread id, a
cpuset id, an irq or a jail id.
Using
.Fl g
the target's set id or mask may be queried.
Using
.Fl l
or
.Fl s
the target's CPU mask or set id may be set.
If no target is specified,
.Nm
operates on itself.
Not all combinations of operations and targets are supported.
For example,
you may not set the id of an existing set or query and launch a command
at the same time.
.Pp
There are two sets applicable to each process and one private mask per thread.
Every process in the system belongs to a cpuset.
By default processes are started in set 1.
The mask or id may be queried using
.Fl c .
Each thread also has a private mask of CPUs it is allowed to run
on that must be a subset of the assigned set.
And finally, there is a root set, numbered 0, that is immutable.
This last set is the list of all possible CPUs in the system and is
queried using
.Fl r .
.Pp
When running a command it may join a set specified with
.Fl s
otherwise a new set is created.
In addition, a mask for the command may be specified using
.Fl l .
When used in conjunction with
.Fl c
the mask modifies the supplied or created set rather than the private mask
for the thread.
.Pp
The options are as follows:
.Bl -tag -width ".Fl l Ar cpu-list"
.It Fl c
The requested operation should reference the cpuset available via the
target specifier.
.It Fl g
Causes
.Nm
to print either a list of valid CPUs or, using 
.Fl i ,
the id of the target.
.It Fl i
When used with the
.Fl g
option print the id rather than the valid mask of the target.
.It Fl j Ar jailid
Specifies a jail id as the target of the operation.
.It Fl l Ar cpu-list
Specifies a list of CPUs to apply to a target.
Specification may include
numbers separated by '-' for ranges and commas separating individual numbers.
.It Fl p Ar pid
Specifies a pid as the target of the operation.
.It Fl s Ar setid 
Specifies a set id as the target of the operation.
.It Fl r
The requested operation should reference the root set available via the
target specifier.
.It Fl t Ar tid
Specifies a thread id as the target of the operation.
.It Fl x Ar irq 
Specifies an irq as the target of the operation.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Create a new group with CPUs 0-4 inclusive and run<commit_msg>Sync manpage's synopsis with program's usage(). Trim whitespace at EOL.<commit_after>.\" Copyright (c) 2008 <NAME>
.\" Copyright (c) 2008 <NAME>
.\" 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 AUTHOR 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 AUTHOR 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.
.\"
.\" $FreeBSD$
.\"
.Dd November 29, 2008
.Dt CPUSET 1
.Os
.Sh NAME
.Nm cpuset
.Nd "configure processor sets"
.Sh SYNOPSIS
.Nm
.Op Fl l Ar cpu-list
.Op Fl s Ar setid
.Ar cmd ...
.Nm
.Op Fl l Ar cpu-list
.Op Fl s Ar setid
.Fl p Ar pid
.Nm
.Op Fl cr
.Op Fl l Ar cpu-list
.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq
.Nm
.Op Fl cgir
.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq
.Sh DESCRIPTION
The
.Nm
command can be used to assign processor sets to processes, run commands
constrained to a given set or list of processors, and query information
about processor binding, sets, and available processors in the system.
.Pp
.Nm
requires a target to modify or query.
The target may be specified as a command, process id, thread id, a
cpuset id, an irq or a jail id.
Using
.Fl g
the target's set id or mask may be queried.
Using
.Fl l
or
.Fl s
the target's CPU mask or set id may be set.
If no target is specified,
.Nm
operates on itself.
Not all combinations of operations and targets are supported.
For example,
you may not set the id of an existing set or query and launch a command
at the same time.
.Pp
There are two sets applicable to each process and one private mask per thread.
Every process in the system belongs to a cpuset.
By default processes are started in set 1.
The mask or id may be queried using
.Fl c .
Each thread also has a private mask of CPUs it is allowed to run
on that must be a subset of the assigned set.
And finally, there is a root set, numbered 0, that is immutable.
This last set is the list of all possible CPUs in the system and is
queried using
.Fl r .
.Pp
When running a command it may join a set specified with
.Fl s
otherwise a new set is created.
In addition, a mask for the command may be specified using
.Fl l .
When used in conjunction with
.Fl c
the mask modifies the supplied or created set rather than the private mask
for the thread.
.Pp
The options are as follows:
.Bl -tag -width ".Fl l Ar cpu-list"
.It Fl c
The requested operation should reference the cpuset available via the
target specifier.
.It Fl g
Causes
.Nm
to print either a list of valid CPUs or, using
.Fl i ,
the id of the target.
.It Fl i
When used with the
.Fl g
option print the id rather than the valid mask of the target.
.It Fl j Ar jailid
Specifies a jail id as the target of the operation.
.It Fl l Ar cpu-list
Specifies a list of CPUs to apply to a target.
Specification may include
numbers separated by '-' for ranges and commas separating individual numbers.
.It Fl p Ar pid
Specifies a pid as the target of the operation.
.It Fl s Ar setid
Specifies a set id as the target of the operation.
.It Fl r
The requested operation should reference the root set available via the
target specifier.
.It Fl t Ar tid
Specifies a thread id as the target of the operation.
.It Fl x Ar irq
Specifies an irq as the target of the operation.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Create a new group with CPUs 0-4 inclusive and run
{'fraction_non_alphanumeric': 0.060146149522203485, 'fraction_numerical': 0.004721753794266442, 'mean_word_length': 3.4148883374689825, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3793358', 'n_tokens_mistral': 2684, 'n_tokens_neox': 2483, 'n_words': 1592}