This manual page explains the tuna program. The program can be used to change the attributes of application and kernel threads. tuna 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.
tuna can change scheduling policy, scheduler priority and processor affinity for processes and process threads. tuna can also change the processor affinity for interrupts. When tuna is invoked without any options it starts up in its graphical interface mode. This manual page explains only the command-line options for tuna
tuna has both action options and modifier options. Modifier options must be specified on the command-line before the actions they are intended to modify. Any modifier option applies to following actions on the same command-line until it is over-ridden.
- -h, --help
Print a list of options. tuna will exit after this action, ignoring the remainder of the command-line.
- -g, --gui
Start the GUI. Actions that follow this on the command-line will be processed without waiting for the GUI to complete.
- -a, --config_file_apply=profilename
Apply changes described in profile
- -l, --config_file_list
List preloaded profiles
- -i, --isolate
Move all threads away from CPU-LIST. Requires -c or -S.
- -I, --include
Allow all threads to run on CPU-LIST. Requires -c or -S.
- -m, --move
Move selected entities to CPU-LIST. Requires -c and either -t or -q.
- -p, --priority=[POLICY:]RTPRIO
Set thread scheduler tunables: POLICY and RTPRIO. POLICY is one of OTHER, FIFO, RR, or BATCH. If -t is not set, -p will act as a Modifier saving the sched tunables for future Actions, for example -r.
- -P, --show_threads
Show thread list.
- -r, --run="COMMAND"
Run the COMMAND. If arguments are passed, the entire command line must be provided inside "quotes". Modifiers -c and -p can be used to set the affinity and scheduler tunables of the given COMMAND. The arg (i.e. the command) will be set in THREAD-LIST. Likewise the -t, the COMMAND accepts the prefix + and - as wildcards in order to be appended or removed from THREAD-LIST, respectively.
- -R, --refresh=MSEC
Refresh the GUI every MSEC milliseconds
- -s, --save=FILENAME
Save kthreads sched tunables to FILENAME.
- -v, --version
- -W, --what_is
Provides help about selected entities. Requires -t.
- -x, --spread
Spread selected entities over CPU-LIST. Requires at least one of -t or -q. The specified threads and IRQs are each assigned to one cpu in CPU-LIST.
- -c, --cpus=CPU-LIST
CPU-LIST affected by commands. Requires a CPU number or a comma-separated list of CPU numbers.
- -C, --affect_children
Operation will affect children threads.
- -d, --disable_perf
Explicitly disable usage of perf in GUI for process view
- -f, --filter
Disable display of selected CPUs in --gui. Requires -cR.
- -G, --cgroup
Display the processes with the type of cgroups they are in. Requires -PR.
- -K, --no_kthreads
Operations will not affect kernel threads.
- -q, --irqs=IRQ-LIST
IRQ-LIST affected by commands. Requires an IRQ number or a comma-separated list of IRQ numbers.
- -S, --sockets=CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands. Requires a socket number or a comma-separated list of socket numbers.
- -t, --threads=THREAD-LIST
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. If only - is passed as argument, the THREAD-LIST will be cleared.
- -U, --no_uthreads
Operations will not affect user threads.
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:
- tuna -S 2 -i -q 'eth*' -x
Move everything off the CPUs in socket 2, then spread the IRQs for the Ethernet devices across those same CPUs.