Add asciidoc man pages and some include files

This commit is contained in:
Mario Blättermann 2021-03-11 18:38:46 +01:00
parent 0b83e26373
commit e2db4d9410
13 changed files with 856 additions and 0 deletions

View File

@ -0,0 +1,175 @@
////
terminal-colors.d.5 --
Copyright 2014 Ondrej Oprala <ooprala@redhat.com>
Copyright (C) 2014 Karel Zak <kzak@redhat.com>
Copyright 2014 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= terminal-colors.d(5)
:doctype: manpage
:man manual: File formats
:man source: util-linux {release-version}
:page-layout: base
:configfile: terminal-colors.d
== NAME
terminal-colors.d - configure output colorization for various utilities
== SYNOPSIS
/etc/terminal-colors.d/_[[name][@term].][type]_
== DESCRIPTION
Files in this directory determine the default behavior for utilities when coloring output.
The _name_ is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities.
The _term_ is a terminal identifier (the TERM environment variable). The terminal identifier is optional and when none is specified then the file is used for all unspecified terminals.
The _type_ is a file type. Supported file types are:
*disable*::
Turns off output colorization for all compatible utilities.
*enable*::
Turns on output colorization; any matching *disable* files are ignored.
*scheme*::
Specifies colors used for output. The file format may be specific to the utility, the default format is described below.
If there are more files that match for a utility, then the file with the more specific filename wins. For example, the filename "@xterm.scheme" has less priority than "dmesg@xterm.scheme". The lowest priority are those files without a utility name and terminal identifier (e.g., "disable").
The user-specific _$XDG_CONFIG_HOME/terminal-colors.d_ or _$HOME/.config/terminal-colors.d_ overrides the global setting.
[[default_scheme_files_format]]
== DEFAULT SCHEME FILES FORMAT
The following statement is recognized:
____
*name color-sequence*
____
The *name* is a logical name of color sequence (for example "error"). The names are specific to the utilities. For more details always see the COLORS section in the man page for the utility.
The *color-sequence* is a color name, ASCII color sequences or escape sequences.
[[color_names]]
=== Color names
black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse, and yellow.
[[ansi_color_sequences]]
=== ANSI color sequences
The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
____
[cols=",",]
|===
|0 |to restore default color
|1 |for brighter colors
|4 |for underlined text
|5 |for flashing text
|30 |for black foreground
|31 |for red foreground
|32 |for green foreground
|33 |for yellow (or brown) foreground
|34 |for blue foreground
|35 |for purple foreground
|36 |for cyan foreground
|37 |for white (or gray) foreground
|40 |for black background
|41 |for red background
|42 |for green background
|43 |for yellow (or brown) background
|44 |for blue background
|45 |for purple background
|46 |for cyan background
|47 |for white (or gray) background
|===
____
[[escape_sequences]]
=== Escape sequences
To specify control or blank characters in the color sequences, C-style BSOL-escaped notation can be used:
____
[cols=",",]
|===
|*BSOLa* |Bell (ASCII 7)
|*BSOLb* |Backspace (ASCII 8)
|*BSOLe* |Escape (ASCII 27)
|*BSOLf* |Form feed (ASCII 12)
|*BSOLn* |Newline (ASCII 10)
|*BSOLr* |Carriage Return (ASCII 13)
|*BSOLt* |Tab (ASCII 9)
|*BSOLv* |Vertical Tab (ASCII 11)
|*BSOL?* |Delete (ASCII 127)
|*BSOL_* |Space
|*BSOLBSOL* |Backslash (BSOL)
|*BSOL^* |Caret (^)
|*BSOL#* |Hash mark (#)
|===
____
Please note that escapes are necessary to enter a space, backslash, caret, or any control character anywhere in the string, as well as a hash mark as the first character.
For example, to use a red background for alert messages in the output of *dmesg*(1), use:
____
*echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme*
____
=== Comments
Lines where the first non-blank character is a # (hash) are ignored. Any other use of the hash character is not interpreted as introducing a comment.
== ENVIRONMENT
TERMINAL_COLORS_DEBUG=all::
enables debug output.
== FILES
_$XDG_CONFIG_HOME/terminal-colors.d_
_$HOME/.config/terminal-colors.d_
_/etc/terminal-colors.d_
== EXAMPLE
Disable colors for all compatible utilities:
____
*touch /etc/terminal-colors.d/disable*
____
Disable colors for all compatible utils on a vt100 terminal:
____
*touch /etc/terminal-colors.d/@vt100.disable*
____
Disable colors for all compatible utils except *dmesg*(1):
____
*touch /etc/terminal-colors.d/disable*
*touch /etc/terminal-colors.d/dmesg.enable*
____
== COMPATIBILITY
The terminal-colors.d functionality is currently supported by all util-linux utilities which provides colorized output. For more details always see the COLORS section in the man page for the utility.
include::../man-common/bugreports.adoc[]
include::../man-common/footer-config.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

64
libblkid/libblkid.3.adoc Normal file
View File

@ -0,0 +1,64 @@
////
Copyright 2001 Andreas Dilger (adilger@turbolinux.com)
This man page was created for libblkid.so.1.0 from e2fsprogs-1.24.
This file may be copied under the terms of the GNU Lesser General Public License.
Created Wed Sep 14 12:02:12 2001, Andreas Dilger
////
= libblkid(3)
:doctype: manpage
:man manual: Programmer's Manual
:man source: util-linux {release-version}
:page-layout: base
:lib: libblkid
:firstversion: 2.15
== NAME
libblkid - block device identification library
*#include <blkid.h>*
*cc* _file.c_ *-lblkid*
== DESCRIPTION
The *libblkid* library is used to identify block devices (disks) as to their content (e.g., filesystem type) as well as extracting additional information such as filesystem labels/volume names, unique identifiers/serial numbers. A common use is to allow use of *LABEL=* and *UUID=* tags instead of hard-coding specific block device names into configuration files.
The low-level part of the library also allows the extraction of information about partitions and block device topology.
The high-level part of the library keeps information about block devices in a cache file and is verified to still be valid before being returned to the user (if the user has read permission on the raw block device, otherwise not). The cache file also allows unprivileged users (normally anyone other than root, or those not in the "disk" group) to locate devices by label/id. The standard location of the cache file can be overridden by the environment variable *BLKID_FILE*.
In situations where one is getting information about a single known device, it does not impact performance whether the cache is used or not (unless you are not able to read the block device directly).
The high-level part of the library supports two methods to evaluate *LABEL/UUID*. It reads information directly from a block device or read information from /dev/disk/by-* udev symlinks. The udev is preferred method by default.
If you are dealing with multiple devices, use of the cache is highly recommended (even if empty) as devices will be scanned at most one time and the on-disk cache will be updated if possible.
In some cases (modular kernels), block devices are not even visible until after they are accessed the first time, so it is critical that there is some way to locate these devices without enumerating only visible devices, so the use of the cache file is *required* in this situation.
[[configuration_file]]
== CONFIGURATION FILE
The standard location of the _/etc/blkid.conf_ config file can be overridden by the environment variable *BLKID_CONF*. For more details about the config file see *blkid*(8) man page.
== AUTHORS
*libblkid* was written by Andreas Dilger for the ext2 filesystem utilities, with input from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o.
The low-level probing code was rewritten by Karel Zak.
== COPYING
*libblkid* is available under the terms of the GNU Library General Public License (LGPL), version 2 (or at your discretion any later version).
[[see_also]]
== SEE ALSO
*blkid*(8),
*findfs*(8)
include::../man-common/footer-lib.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

16
man-common/README Normal file
View File

@ -0,0 +1,16 @@
To get the groff version from an asciidoc man page (example for schedutils/ionice.1.adoc):
asciidoctor -b manpage \
-a release-version=2.37 \
-D output_directory \
ionice.1.adoc
The headers of the asciidoc files already contain relative paths to the files in man-common.
The groff man page libblikid.3 contains the version number of util-linux from which this library available:
.SH AVAILABILITY
libblkid is part of the util-linux package since version 2.15 and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.
I've replaced this section with a generic footer for library man pages; if you consider this version number as important, I will replace the footer with the original static AVAILABILITY section.

View File

@ -0,0 +1,3 @@
== REPORTING BUGS
For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.

View File

@ -0,0 +1,4 @@
== AVAILABILITY
// TRANSLATORS: Keep *{configfile}* untranslated, it will be replaced with the name of the configuration file.
*{configfile}* is part of the util-linux package which can be downloaded from https://www.kernel.org/pub/linux/utils/util-linux/[Linux Kernel Archive].

View File

@ -0,0 +1,4 @@
== AVAILABILITY
// TRANSLATORS: Keep *{lib}* and {firstversion} untranslated, will be replaced with the library name and the version of util-linux where the library appeared for the first time.
The *{lib}* library is part of the util-linux package since version {firstversion}. It can be downloaded from https://www.kernel.org/pub/linux/utils/util-linux/[Linux Kernel Archive].

4
man-common/footer.adoc Normal file
View File

@ -0,0 +1,4 @@
== AVAILABILITY
// TRANSLATORS: Keep *{command}* untranslated, it will be replaced with the command name.
The *{command}* command is part of the util-linux package which can be downloaded from https://www.kernel.org/pub/linux/utils/util-linux/[Linux Kernel Archive].

View File

@ -0,0 +1,50 @@
= foobar(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: foobar
== NAME
foobar - do nothing
== SYNOPSIS
*foobar* _options file_
== DESCRIPTION
Describe *foobar* briefly.
== OPTIONS
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== NOTES
Put your notes here which don't match any other paragraph.
== AUTHORS
....
John Doe <john.doe@example.com>
....
[[see_also]]
== SEE ALSO
*foo*(1),
*bar*(1)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,12 @@
== TRANSLATION
For the authors of this translation, see the header of the corresponding
*.po file at GNU TP:
http://translationproject.org/domain/util-linux-man.html
////
TRANSLATORS: Please replace %1 with the address of the mailing list of your
translation team.
////
Report man page translation bugs to:
<%1>

160
schedutils/chrt.1.adoc Normal file
View File

@ -0,0 +1,160 @@
////
chrt(1) manpage
Copyright (C) 2004 Robert Love
Copyright (C) 2015 Karel Zak <kzak@redhat.com>
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License,
version 2, as published by the Free Software Foundation.
The GNU General Public License's references to "object code"
and "executables" are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
= chrt(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: chrt
== NAME
chrt - manipulate the real-time attributes of a process
== SYNOPSIS
*chrt* _options priority command argument_ …
*chrt* _options_ *-p* _priority PID_
== DESCRIPTION
*chrt* sets or retrieves the real-time scheduling attributes of an existing _PID_, or runs _command_ with the given attributes.
== POLICIES
*-o*, *--other*::
Set scheduling policy to *SCHED_OTHER* (time-sharing scheduling). This is the default Linux scheduling policy.
*-f*, *--fifo*::
Set scheduling policy to *SCHED_FIFO* (first in-first out).
*-r*, *--rr*::
Set scheduling policy to *SCHED_RR* (round-robin scheduling). When no policy is defined, the *SCHED_RR* is used as the default.
*-b*, *--batch*::
Set scheduling policy to *SCHED_BATCH* (scheduling batch processes). Linux-specific, supported since 2.6.16. The priority argument has to be set to zero.
*-i*, *--idle*::
Set scheduling policy to *SCHED_IDLE* (scheduling very low priority jobs). Linux-specific, supported since 2.6.23. The priority argument has to be set to zero.
*-d*, *--deadline*::
Set scheduling policy to *SCHED_DEADLINE* (sporadic task model deadline scheduling). Linux-specific, supported since 3.14. The priority argument has to be set to zero. See also *--sched-runtime*, *--sched-deadline* and *--sched-period*. The relation between the options required by the kernel is
runtime <= deadline <= period. *chrt* copies _period_ to _deadline_ if *--sched-deadline* is not specified and _deadline_ to _runtime_ if *--sched-runtime* is not specified. It means that at least *--sched-period* has to be specified. See *sched*(7) for more details.
[[scheduling_options]]
== SCHEDULING OPTIONS
*-T*, *--sched-runtime* _nanoseconds_::
Specifies runtime parameter for *SCHED_DEADLINE* policy (Linux-specific).
*-P*, *--sched-period* _nanoseconds_::
Specifies period parameter for *SCHED_DEADLINE* policy (Linux-specific).
*-D*, *--sched-deadline* _nanoseconds_::
Specifies deadline parameter for *SCHED_DEADLINE* policy (Linux-specific).
*-R*, *--reset-on-fork*::
Use *SCHED_RESET_ON_FORK* or *SCHED_FLAG_RESET_ON_FORK* flag. Linux-specific,
supported since 2.6.31.
Each thread has a _reset-on-fork_ scheduling flag. When this flag is set, children created by *fork*(2) do not inherit privileged scheduling policies. After the _reset-on-fork_ flag has been enabled, it can be reset only if the thread has the *CAP_SYS_NICE* capability. This flag is disabled in child processes created by *fork*(2).
More precisely, if the _reset-on-fork_ flag is set, the following rules apply for subsequently created children:
* If the calling thread has a scheduling policy of *SCHED_FIFO* or *SCHED_RR*,
the policy is reset to *SCHED_OTHER* in child processes.
* If the calling process has a negative nice value, the nice value is reset to
zero in child processes.
== OPTIONS
*-a*, *--all-tasks*::
Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID.
*-m*, *--max*::
Show minimum and maximum valid priorities, then exit.
*-p*, *--pid*::
Operate on an existing PID and do not launch a new task.
*-v*, *--verbose*::
Show status information.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== USAGE
The default behavior is to run a new command:::
*chrt* _priority_ _command_ [_arguments_]
You can also retrieve the real-time attributes of an existing task:::
*chrt -p* _PID_
Or set them:::
*chrt -r -p* _priority PID_
== PERMISSIONS
A user must possess *CAP_SYS_NICE* to change the scheduling attributes of a process. Any user can retrieve the scheduling information.
== NOTES
Only *SCHED_FIFO*, *SCHED_OTHER* and *SCHED_RR* are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes may be ignored on some systems.
Linux' default scheduling policy is *SCHED_OTHER*.
== AUTHORS
....
Robert Love <rml@tech9.net>
Karel Zak <kzak@redhat.com>
....
[[see_also]]
== SEE ALSO
*nice*(1),
*renice*(1),
*taskset*(1),
*sched*(7)
See *sched_setscheduler*(2) for a description of the Linux scheduling scheme.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

98
schedutils/ionice.1.adoc Normal file
View File

@ -0,0 +1,98 @@
= ionice(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: ionice
== NAME
ionice - set or get process I/O scheduling class and priority
== SYNOPSIS
*ionice* *-c* _class_ *-n* _level_ *-t* *-p* _PID_
*ionice* *-c* _class_ *-n* _level_ *-t* *-P* _PGID_
*ionice* *-c* _class_ *-n* _level_ *-t* *-u* _UID_
*ionice* *-c* _class_ *-n* _level_ *-t* _command_ [argument] ...
== DESCRIPTION
This program sets or gets the I/O scheduling class and priority for a program. If no arguments or just *-p* is given, *ionice* will query the current I/O scheduling class and priority for that process.
When _command_ is given, *ionice* will run this command with the given arguments. If no _class_ is specified, then _command_ will be executed with the "best-effort" scheduling class. The default priority level is 4.
As of this writing, a process can be in one of three scheduling classes:
*Idle*::
A program running with idle I/O priority will only get disk time when no other program has asked for disk I/O for a defined grace period. The impact of an idle I/O process on normal system activity should be zero. This scheduling class does not take a priority argument. Presently, this scheduling class is permitted for an ordinary user (since kernel 2.6.25).
*Best-effort*::
This is the effective scheduling class for any process that has not asked for a specific I/O priority. This class takes a priority argument from _0-7_, with a lower number being higher priority. Programs running at the same best-effort priority are served in a round-robin fashion. +
Note that before kernel 2.6.26 a process that has not asked for an I/O priority formally uses "*none*" as scheduling class, but the I/O scheduler will treat such processes as if it were in the best-effort class. The priority within the best-effort class will be dynamically derived from the CPU nice level of the process: io_priority = (cpu_nice + 20) / 5. +
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
*Realtime*::
The RT scheduling class is given first access to the disk, regardless of what else is going on in the system. Thus the RT class needs to be used with some care, as it can starve other processes. As with the best-effort class, 8 priority levels are defined denoting how big a time slice a given process will receive on each scheduling window. This scheduling class is not permitted for an ordinary (i.e., non-root) user.
== OPTIONS
*-c*, *--class* _class_::
Specify the name or number of the scheduling class to use; `0` for none, `1` for realtime, `2` for best-effort, `3` for idle.
*-n*, *--classdata* _level_::
Specify the scheduling class data. This only has an effect if the class accepts an argument. For realtime and best-effort, _0-7_ are valid data (priority levels), and `0` represents the highest priority level.
*-p*, *--pid* _PID_...::
Specify the process IDs of running processes for which to get or set the scheduling parameters.
*-P*, *--pgid* _PGID_...::
Specify the process group IDs of running processes for which to get or set the scheduling parameters.
*-t*, *--ignore*::
Ignore failure to set the requested priority. If _command_ was specified, run it even in case it was not possible to set the desired scheduling priority, which can happen due to insufficient privileges or an old kernel version.
*-h*, *--help*::
Display help text and exit.
*-u*, *--uid* _UID_...::
Specify the user IDs of running processes for which to get or set the scheduling parameters.
*-V*, *--version*::
Display version information and exit.
== NOTES
Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ I/O scheduler.
== EXAMPLES
* # *ionice* -c 3 -p 89
* Sets process with PID 89 as an idle I/O process.
* # *ionice* -c 2 -n 0 bash
* Runs 'bash' as a best-effort program with highest priority.
* # *ionice* -p 89 91
* Prints the class and priority of the processes with PID 89 and 91.
== AUTHORS
....
Jens Axboe <jens@axboe.dk>
Karel Zak <kzak@redhat.com>
....
[[see_also]]
== SEE ALSO
*ioprio_set*(2)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

125
schedutils/taskset.1.adoc Normal file
View File

@ -0,0 +1,125 @@
////
taskset(1) manpage
Copyright (C) 2004 Robert Love
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License,
version 2, as published by the Free Software Foundation.
The GNU General Public License's references to "object code"
and "executables" are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
= taskset(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: taskset
== NAME
taskset - set or retrieve a process's CPU affinity
== SYNOPSIS
*taskset* _options mask command argument_
*taskset* _options_ *-p* _mask pid_
== DESCRIPTION
The *taskset* command is used to set or retrieve the CPU affinity of a running process given its _pid_, or to launch a new _command_ with a given CPU affinity. CPU affinity is a scheduler property that "bonds" a process to a given set of CPUs on the system. The Linux scheduler will honor the given CPU affinity and the process will not run on any other CPUs. Note that the Linux scheduler also supports natural CPU affinity: the scheduler attempts to keep processes on the same CPU as long as practical for performance reasons. Therefore, forcing a specific CPU affinity is useful only in certain applications.
The CPU affinity is represented as a bitmask, with the lowest order bit corresponding to the first logical CPU and the highest order bit corresponding to the last logical CPU. Not all CPUs may exist on a given system but a mask may specify more CPUs than are present. A retrieved mask will reflect only the bits that correspond to CPUs physically on the system. If an invalid mask is given (i.e., one that corresponds to no valid CPUs on the current system) an error is returned. The masks may be specified in hexadecimal (with or without a leading "0x"), or as a CPU list with the *--cpu-list* option. For example,
____
*0x00000001*::
is processor #0,
*0x00000003*::
is processors #0 and #1,
*0xFFFFFFFF*::
is processors #0 through #31,
*32*::
is processors #1, #4, and #5,
*--cpu-list 0-2,6*::
is processors #0, #1, #2, and #6.
*--cpu-list 0-10:2*::
is processors #0, #2, #4, #6, #8 and #10. The suffix ":N" specifies stride in the range, for example 0-10:3 is interpreted as 0,3,6,9 list.
____
When *taskset* returns, it is guaranteed that the given program has been scheduled to a legal CPU.
== OPTIONS
*-a*, *--all-tasks*::
Set or retrieve the CPU affinity of all the tasks (threads) for a given PID.
*-c*, *--cpu-list*::
Interpret _mask_ as numerical list of processors instead of a bitmask. Numbers are separated by commas and may include ranges. For example: *0,5,8-11*.
*-p*, *--pid*::
Operate on an existing PID and do not launch a new task.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== USAGE
The default behavior is to run a new command with a given affinity mask:::
*taskset* _mask_ _command_ [_arguments_]
You can also retrieve the CPU affinity of an existing task:::
*taskset -p* _pid_
Or set it:::
*taskset -p* _mask pid_
== PERMISSIONS
A user can change the CPU affinity of a process belonging to the same user. A user must possess *CAP_SYS_NICE* to change the CPU affinity of a process belonging to another user. A user can retrieve the affinity mask of any process.
== AUTHORS
Written by Robert M. Love.
== COPYRIGHT
Copyright © 2004 Robert M. Love. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[[see_also]]
== SEE ALSO
*chrt*(1),
*nice*(1),
*renice*(1),
*sched_getaffinity*(2),
*sched_setaffinity*(2)
See *sched*(7) for a description of the Linux scheduling scheme.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

141
schedutils/uclampset.1.adoc Normal file
View File

@ -0,0 +1,141 @@
////
uclampset(1) manpage
Copyright (C) 2020-2021 Qais Yousef <qais.yousef@arm.com>
Copyright (C) 2020-2021 Arm Ltd
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License,
version 2, as published by the Free Software Foundation.
The GNU General Public License's references to "object code"
and "executables" are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
= uclampset(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: uclampset
== NAME
uclampset -
manipulate the utilization clamping attributes of the system or a process
== SYNOPSIS
*uclampset* _options_ *-m* _uclamp_min_ *-M* _uclamp_max command argument_
*uclampset* _options_ *-m* _uclamp_min_ *-M* _uclamp_max_ *-p* _PID_
== DESCRIPTION
*uclampset* sets or retrieves the utilization clamping attributes of an existing _PID_, or runs _command_ with the given attributes.
Utilization clamping is a new feature added in v5.3. It gives a hint to the scheduler about the allowed range of utilization the task should be operating at.
The utilization of the task affects frequency selection and task placement. Only schedutil cpufreq governor understands handling util clamp hints at the time of writing. Consult your kernel docs for further info about other cpufreq governors support.
If you're running on asymmetric heterogeneous system like Arm's big.LITTLE. Utilization clamping can help bias task placement. If the task is boosted such that *util_min* value is higher than the little cores' capacity, then the scheduler will do its best to place it on a big core.
Similarly, if *util_max* is smaller than or equal the capacity of the little cores, then the scheduler can still choose to place it there even if the actual utilization of the task is at max.
Setting a task's *uclamp_min* to a none zero value will effectively boost the task as when it runs it'll always start from this utilization value.
By setting a task's *uclamp_max* below 1024, this will effectively cap the task as when it runs it'll never be able to go above this utilization value.
The full utilization range is: [0:1024]. The special value -1 is used to reset to system's default.
== OPTIONS
*-m*::
Set _util_min_ value.
*-M*::
Set _util_max_ value.
*-a*, *--all-tasks*::
Set or retrieve the utilization clamping attributes of all the tasks (threads) for a given PID.
*-p*, *--pid*::
Operate on an existing PID and do not launch a new task.
*-s*, *--system*::
Set or retrieve the system-wide utilization clamping attributes.
*-R*, *--reset-on-fork*::
Set *SCHED_FLAG_RESET_ON_FORK* flag
*-v*, *--verbose*::
Show status information.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== USAGE
The default behavior is to run a new command:::
*uclampset* _[-m uclamp_min]_ _[-M uclamp_max]_ _command_ [_arguments_]
You can also retrieve the utilization clamping attributes of an existing task:::
*uclampset -p* _PID_
Or set them:::
*uclampset -p* _PID_ _[-m uclamp_min]_ _[-M uclamp_max]_
Or control the system-wide attributes:::
*uclampset -s* _[-m uclamp_min]_ _[-M uclamp_max]_
== PERMISSIONS
A user must possess *CAP_SYS_NICE* to change the scheduling attributes of a process. Any user can retrieve the scheduling information.
== NOTES
The system wide utilization clamp attributes are there to control the _allowed_ range the tasks can use. By default both _uclamp_min_ and _uclamp_max_ are set to 1024. This means users can set the utilization clamp values for their task across the full range [0:1024].
For example:::
*uclampset -s* `-m 512` `-M 700`
will prevent any task from being boosted higher than 512. And all tasks in the systems are capped to a utilization of 700. Effectively rendering the maximum performance of the system to 700.
Consult your kernel docs for the exact expected behavior on that kernel.
== AUTHORS
....
Qais Yousef <qais.yousef@arm.com>
....
[[see_also]]
== SEE ALSO
*nice*(1),
*renice*(1),
*taskset*(1),
*sched*(7)
See *sched_setscheduler*(2) and *sched_setattr*(2) for a description of the Linux scheduling scheme.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]