blob: 242389455f839195ab41e5faba7f5cb10bf23128 [file] [log] [blame]
.TH TUNA "8" "February 2010" "tuna" "System Administration Utilities"
.SH NAME
tuna \- program for tuning running processes
.SH SYNOPSIS
.B tuna
[\fIOPTIONS\fR]
.SH DESCRIPTION
This manual page explains the \fBtuna\fR program. The program can be used to change the attributes of application and kernel threads. \fBtuna\fR can operate on IRQs by name or number, and tasks or threads by process ID or command-line. CPUs and sets of CPUs can be specified by CPU or socket number. IRQ names and process command-lines can include wildcards.
.PP
\fBtuna\fP can change scheduling policy, scheduler priority and processor affinity for processes and process threads. \fBtuna\fR can also change the processor affinity for interrupts.
When \fBtuna\fR is invoked without any options it starts up in its graphical interface mode. This manual page explains only the command\-line options for \fBtuna\fR
.SH "GLOBAL OPTIONS"
.TP
\fB\-h\fR, \fB\-\-help\fR
Print a list of options. \fBtuna\fR will exit after this action, ignoring the remainder of the command-line.
.TP
\fB\-v\fR, \fB\-\-version\fR
Show version
.TP
\fB\-L\fR, \fB\-\-logging\fR=\fILOG-LEVEL\fR
Log application details to file for given LOG-LEVEL
.TP
\fB\-D\fR, \fB\-\-debug\fR
Print DEBUG level logging details to console
.SH "COMMANDS"
.TP
\fBtuna isolate\fR
usage: tuna-cmd.py isolate [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
Move all allowed threads and IRQs away from CPU\-LIST. Requires \fB\-c\fR, \fB-S\fR, or \fB-N\fR.
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
.TP
\fBtuna include\fR
usage: tuna-cmd.py include [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
Allow all allowed threads and IRQs to run on CPU\-LIST. Requires \fB\-c\fR, \fB-S\fR, or \fB-N\fR.
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
.TP
\fBtuna move\fR
usage: tuna-cmd.py move [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
[-t THREAD-LIST] [-q IRQ-LIST]
Move selected entities to CPU\-LIST. Requires \fB\-c\fR, \fB-S\fR, or \fB-N\fR and \fB-t\fR or \fB-q\fR.
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-t THREAD-LIST, --threads THREAD-LIST
THREAD-LIST affected by commands
-q IRQ-LIST, --irqs IRQ-LIST
IRQ-LIST affect by commands
.TP
\fBtuna spread\fR
usage: tuna-cmd.py spread [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
[-t THREAD-LIST] [-q IRQ-LIST]
Spread selected entities over CPU-LIST. The specified threads and IRQs are each assigned to one cpu in CPU-LIST. Requires \fB\-c\fR, \fB-S\fR, or \fB-N\fR and \fB-t\fR or \fB-q\fR.
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-t THREAD-LIST, --threads THREAD-LIST
THREAD-LIST affected by commands
-q IRQ-LIST, --irqs IRQ-LIST
IRQ-LIST affect by commands
.TP
\fBtuna priority\fR
usage: tuna-cmd.py priority [-h] -t THREAD-LIST [-C] POLICY:RTPRIO
Set thread scheduler tunables: POLICY and RTPRIO. POLICY is one of OTHER, FIFO, RR, or BATCH. Provide POLICY, RTPRIO, or POLICY:RTPRIO separated by ":". If only POLICY is set, the RT priority will default to 1 if the policy is RT, and 0 otherwise. If only RTPRIO is specified, policy will not be changed.
positional arguments:
POLICY:RTPRIO Set thread scheduler tunables: POLICY and RTPRIO
optional arguments:
-h, --help show this help message and exit
-t THREAD-LIST, --threads THREAD-LIST
THREAD-LIST affected by commands
-C, --affect_children
Operation will affect children threads
.TP
\fBtuna run\fR
usage: tuna-cmd.py run [-h] [-c CPU-LIST | -S CPU-SOCKET-LIST | -N]
[-p PRIORITY] [-b]
COMMAND
Run the COMMAND. The entire command line must be provided inside "quotes". Modifiers \fB-c\fR, \fB-S\fR and \fB-p\fR can be used to set the affinity and scheduler tunables of the given COMMAND.
positional arguments:
COMMAND fork a new process and run the "COMMAND"
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-p PRIORITY, --priority PRIORITY
Set thread scheduler tunables: POLICY and RTPRIO
-b, --background Run command as background task
.TP
\fBtuna save\fR
usage: tuna-cmd.py save [-h] [-c CPU-LIST | -S CPU-SOCKET-LIST | -N]
[-t THREAD-LIST]
FILENAME
Save kthreads sched tunables to FILENAME
positional arguments:
FILENAME Save kthreads sched tunables to this file
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-t THREAD-LIST, --threads THREAD-LIST
THREAD-LIST affected by commands
.TP
\fBtuna apply\fR
usage: tuna-cmd.py apply [-h] profilename
Apply changes described in profile
positional arguments:
profilename Apply changes described in this file
optional arguments:
-h, --help show this help message and exit
.TP
\fBtuna show_threads\fR
usage: tuna-cmd.py show_threads [-h] [-c CPU-LIST | -N | -S CPU-SOCKET-LIST]
[-t THREAD-LIST | -q IRQ-LIST] [-U] [-K] [-C]
[-G]
Show thread list
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-t THREAD-LIST, --threads THREAD-LIST
THREAD-LIST affected by commands
-q IRQ-LIST, --irqs IRQ-LIST
IRQ-LIST affect by commands
-U, --no_uthreads Operations will not affect user threads
-K, --no_kthreads Operations will not affect kernel threads
-C, --affect_children
Operation will affect children threads
-G, --cgroups Display the processes with the type of cgroups they
are in
-z, --spaced Display spaced view for cgroups
.TP
\fBtuna show_irqs\fR
usage: tuna-cmd.py show_irqs [-h] [-c CPU-LIST | -N | -S CPU-SOCKET-LIST]
[-q IRQ-LIST]
Show IRQ list
optional arguments:
-h, --help show this help message and exit
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-q IRQ-LIST, --irqs IRQ-LIST
IRQ-LIST affect by commands
.TP
\fBtuna show_configs\fR
usage: tuna-cmd.py show_configs [-h]
List preloaded profiles
optional arguments:
-h, --help show this help message and exit
.TP
\fB tuna what_is\fR
usage: tuna-cmd.py what_is [-h] THREAD-LIST
Provides help about selected entities
positional arguments:
THREAD-LIST THREAD-LIST affected by commands
optional arguments:
-h, --help show this help message and exit
.TP
\fB tuna gui\fR
usage: tuna-cmd.py gui [-h] [-d] [-R MSEC]
[-c CPU-LIST | -N | -S CPU-SOCKET-LIST] [-U] [-K]
Start the GUI
optional arguments:
-h, --help show this help message and exit
-d, --disable_perf Explicitly disable usage of perf in GUI for process
view
-R MSEC, --refresh MSEC
Refresh the GUI every MSEC milliseconds
-c CPU-LIST, --cpus CPU-LIST
CPU-LIST affected by commands
-N, --nohz_full CPUs in nohz_full kernel command line will be affected
by operations
-S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands
-U, --no_uthreads Operations will not affect user threads
-K, --no_kthreads Operations will not affect kernel threads
.IP \fIModifiers\fR
.TP
\fB\-c\fR, \fB\-\-cpus\fR=\fICPU\-LIST\fR
CPU\-LIST affected by commands. Requires a CPU number, a range, or a comma-separated list of CPU numbers.
.TP
\fB\-S\fR, \fB\-\-sockets\fR=\fICPU\-SOCKET\-LIST\fR
CPU\-SOCKET\-LIST affected by commands. Requires a socket number or a comma-separated list of socket numbers.
.TP
\fB\-t\fR, \fB\-\-threads\fR=\fITHREAD\-LIST\fR
THREAD\-LIST affected by commands. Requires a thread number or thread name, or a comma-separated list of thread numbers and/or names. Thread names may contain wildcards. Be sure to quote or escape any wildcard specifications.
.TP
.SH USAGE EXAMPLES
If for instance the Ethernet NICs have multiple queues for both receive and transmit, each with its own IRQ, the Ethernet IRQs can be associated with a CPU socket:
.TP
.B tuna isolate -S 2
.TP
.B tuna spread -q 'eth*' -S 2
Move everything off the CPUs in socket 2, then spread the IRQs for the Ethernet devices across those same CPUs.