TUNA(8)

okay bestie, hydrate πŸ’§, put your phone on do-not-disturb, because this is TUNA(8) from the System Administration Utilities corner of the manual and she is long. But that's fine, we're built different. Let's go. πŸ’…

🌸 NAME 🌸

tuna β€” program for tuning running processes ✨


🐟 SYNOPSIS 🐟

tuna [OPTIONS]

πŸ’– DESCRIPTION πŸ’–

So this manual page explains the tuna program, bestie. What it does is it changes the attributes of application and kernel threads. That's the whole vibe.

tuna can operate on IRQs by name or number, and on tasks or threads by process ID or command-line. CPUs and sets of CPUs can be specified by CPU or socket number. And here's the fun part β€” IRQ names and process command-lines can include wildcards. slay. πŸ¦‹

tuna can change scheduling policy, scheduler priority and processor affinity for processes and process threads. tuna can also change the processor affinity for interrupts. And it supports cgroup v2 cpusets for CPU and memory node isolation, which gives you fine-grained control over which processes can run on which CPUs. very main character of it. πŸ‘‘

🌟 lowkey important: 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.

✨ GLOBAL OPTIONS ✨

  • -h, --help β€” Print a list of options. tuna will exit after this action, ignoring the remainder of the command-line. πŸšͺ
  • -v, --version β€” Show version. πŸ“Œ
  • -L, --logging=LOG-LEVEL β€” Log application details to file for given LOG-LEVEL. πŸ—’οΈ
  • -D, --debug β€” Print DEBUG level logging details to console. πŸ›
  • -w, --warn β€” Warn when thread/IRQ patterns match nothing. ⚠️

πŸŽ€ COMMANDS πŸŽ€


πŸ”‹ tuna cpu_power

usage: tuna-cmd.py cpu_power [-h] (-c CPU-LIST)

Set or query the idle (power) states of all or a selection of cpus in the CPU-LIST. Modifiers -c may be used to pass the CPU-LIST of cpus to perform the command on. πŸ’€

optional arguments:

  • -h, --help β€” show this help message and exit
  • -i, --idle-info β€” Print general idle information for the selected CPUs, including index values for IDLE-STATE.
  • -s, --status IDLE-STATE β€” Print whether IDLE-STATE is enabled on the selected CPUs.
  • -d, --disable IDLE-STATE β€” Disable IDLE-STATE on the selected CPUs.
  • -e, --enable IDLE-STATE β€” Enable IDLE-STATE on the selected CPUs.
  • -c CPU-LIST, --cpus CPU-LIST β€” CPU-LIST affected by commands

🧊 tuna isolate

usage: tuna-cmd.py isolate [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
                           [--cpuset [NAME]] [--cpuset-housekeeping ...]

Move all allowed threads and IRQs away from CPU-LIST. Requires -c, -S, or -N. bye bestie πŸ‘‹

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
  • --cpuset [NAME] β€” Use cpusets for isolation with optional name (default: tuna_isolated, partition=isolated)
  • --cpuset-housekeeping [NAME] CPU-LIST β€” Create housekeeping cpuset: [NAME] CPU-LIST (default name: tuna_housekeeping, partition=member)

🫢 tuna include

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 -c, -S, or -N. come back home 🏑

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

🚚 tuna move

usage: tuna-cmd.py move [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N | --cpuset CPUSET-NAME)
                        [-t THREAD-LIST] [-q IRQ-LIST] [-U] [-K]

Move selected entities to CPU-LIST or cpuset. Requires -c, -S, -N, or --cpuset and -t or -q. πŸ“¦

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
  • --cpuset CPUSET-NAME β€” Move threads/IRQs into cpuset (cgroup v2) instead of setting CPU affinity
  • -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

πŸ¦‹ tuna spread

usage: tuna-cmd.py spread [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
                          [-t THREAD-LIST] [-q IRQ-LIST] [-U] [-K]

Spread selected entities over CPU-LIST. The specified threads and IRQs are each assigned to one cpu in CPU-LIST. Requires -c, -S, or -N and -t or -q. it's giving ✨even distribution✨

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
  • -U, --no_uthreads β€” Operations will not affect user threads
  • -K, --no_kthreads β€” Operations will not affect kernel threads

πŸ‘‘ tuna priority

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. no cap. 🎯

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

πŸƒ tuna run

usage: tuna-cmd.py run [-h] [-c CPU-LIST | -S CPU-SOCKET-LIST | -N | --cpuset CPUSET-NAME]
                       [-p PRIORITY] [-b]
                       COMMAND

Run the COMMAND. The entire command line must be provided inside "quotes". Modifiers -c, -S, --cpuset and -p can be used to set the affinity and scheduler tunables of the given COMMAND. go off πŸ’¨

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
  • --cpuset CPUSET-NAME β€” Run process in specified cpuset (cgroup v2) instead of setting CPU affinity
  • -p PRIORITY, --priority PRIORITY β€” Set thread scheduler tunables: POLICY and RTPRIO
  • -b, --background β€” Run command as background task

πŸ’Ύ tuna save

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

🧡 tuna show_threads

usage: tuna-cmd.py show_threads [-h] [-c CPU-LIST | -N | -S CPU-SOCKET-LIST]
                                [-t THREAD-LIST | -q IRQ-LIST] [-U] [-K] [-C]
                                [-n] [-G] [--cpuset CPUSET-NAME] [-z]

Show thread list πŸ‘€

  • -h, --help β€” the classic: pops the help message and dips πŸ’…
  • -c CPU-LIST, --cpus CPU-LIST β€” the CPU-LIST that your commands are gonna hit ✨
  • -N, --nohz_full β€” whatever CPUs are sitting in the nohz_full kernel command line get caught up in the operations too, no cap πŸŒ€
  • -S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST β€” same energy, but for the CPU-SOCKET-LIST 🧦
  • -t THREAD-LIST, --threads THREAD-LIST β€” the THREAD-LIST the commands are gonna affect 🧡
  • -q IRQ-LIST, --irqs IRQ-LIST β€” the IRQ-LIST the commands are gonna affect ⚑
  • -U, --no_uthreads β€” operations will not touch user threads, they said what they said πŸ™…β€β™€οΈ
  • -K, --no_kthreads β€” and operations will not touch kernel threads either, boundaries bestie 🚧
  • -C, --affect_children β€” the operation spreads to children threads too, it's giving family plan 🫢
  • -n, --show_sockets β€” shows the network sockets that threads are using (heads up: this one needs the inet_diag module, so hydrate it first) πŸ”Œ
  • -G, --cgroups β€” displays the processes plus which type of cgroups they're living in, showing you the whole apartment building 🏒
  • --cpuset CPUSET-NAME β€” only shows threads inside the cpuset you named πŸ“›
  • -z, --spaced β€” the spaced-out view for cgroups, aesthetically pleasing, we love a layout πŸ’

tuna show_irqs 🌈

tuna-cmd.py show_irqs [-h] [-c CPU-LIST | -N | -S CPU-SOCKET-LIST] [-q IRQ-LIST]

Show IRQ list β€” literally just shows you the IRQ list, that's the whole vibe πŸ‘‘

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -c CPU-LIST, --cpus CPU-LIST β€” CPU-LIST affected by commands
  • -N, --nohz_full β€” CPUs in the 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 affected by commands

tuna show_configs πŸŽ€

tuna-cmd.py show_configs [-h]

List preloaded profiles β€” shows you the profiles that are already loaded up and ready πŸ—‚οΈ

Optional arguments:

  • -h, --help β€” shows this help message and exits

tuna what_is πŸ¦‹

tuna-cmd.py what_is [-h] THREAD-LIST

Provides help about selected entities β€” like a lil "who even is this" lookup service, but for threads πŸ”

Positional arguments:

  • THREAD-LIST β€” THREAD-LIST affected by commands

Optional arguments:

  • -h, --help β€” shows this help message and exits

tuna gui ✨

tuna-cmd.py gui [-h] [-d] [-R MSEC] [-c CPU-LIST | -N | -S CPU-SOCKET-LIST] [-U] [-K]

Start the GUI β€” yes bestie, a whole graphical interface, main character energy πŸ–₯οΈπŸ’–

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -d, --disable_perf β€” explicitly disables using perf in the GUI for the process view, no perf for you πŸ™ˆ
  • -R MSEC, --refresh MSEC β€” refreshes the GUI every MSEC milliseconds, so pick your chaos level ⏱️
  • -c CPU-LIST, --cpus CPU-LIST β€” CPU-LIST affected by commands
  • -N, --nohz_full β€” CPUs in the 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

tuna cpuset 🧚

tuna-cmd.py cpuset [-h] {create,list,destroy,move,show,status,modify,save,apply}

Manage CPU sets (cgroup v2). Cpusets give you fine-grained control over which CPUs processes are allowed to run on, and they come with NUMA-aware memory node assignment plus kernel-enforced isolation. It's giving ✨control✨.

Subcommands:

  • {create,list,destroy,move,show,status,modify,save,apply}

tuna cpuset create 🌱

tuna-cmd.py cpuset create [-h] -c CPU-LIST [-n NAME] [-i] [-m MEM-NODES]

Create a new cpuset with specified CPUs. Memory nodes get auto-detected from CPU topology unless you go out of your way to set them manually πŸͺ„

Required arguments:

  • -c CPU-LIST, --cpus CPU-LIST β€” CPU-LIST to assign to the cpuset

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -n NAME, --name NAME β€” cpuset name (default: auto-generate tunaN) 🏷️
  • -i, --isolated β€” sets the CPU partition to isolated, which is kernel-enforced exclusivity, very VIP rope situation 🚧
  • -m MEM-NODES, --memory-nodes MEM-NODES β€” memory nodes (default: auto-detect from CPUs, e.g., "0" or "0-1")

tuna cpuset list πŸ“‹

tuna-cmd.py cpuset list [-h] [-p PATTERN] [-v] [--show-empty] [--no-recursive]

List cpusets. By default, empty cpusets (the ones with no CPUs assigned) get skipped, because we're not doing filler content 🚫

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -p PATTERN, --pattern PATTERN β€” filter by glob pattern (e.g., tuna*) πŸ”Ž
  • -v, --verbose β€” show detailed info (CPUs, tasks, partition type), spill the tea β˜•
  • --show-empty β€” include cpusets with no CPUs assigned (default: skip empty)
  • --no-recursive β€” only search top-level cpusets, surface level only 🫧

tuna cpuset destroy πŸ’€

tuna-cmd.py cpuset destroy [-h] [-p PATTERN] [-f] [--include-empty] [--no-recursive] [NAME ...]

Destroy cpuset(s) β€” yep, we're deleting them, rest in peace πŸͺ¦

Positional arguments:

  • NAME β€” cpuset name(s) to destroy (one or more, OR use --pattern)

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -p PATTERN, --pattern PATTERN β€” glob pattern to destroy multiple cpusets (e.g., tuna*)
  • -f, --force β€” migrate tasks to the root cgroup before destroying, so nobody gets left homeless 🏠
  • --include-empty β€” when using --pattern, include cpusets with no CPUs assigned
  • --no-recursive β€” only destroy top-level cpusets when using --pattern

tuna cpuset move 🚚

tuna-cmd.py cpuset move [-h] [-t THREAD-LIST] [-p PID-LIST] NAME

Move processes to a cpuset β€” relocation era, new cpuset, who dis πŸ“¦

Positional arguments:

  • NAME β€” cpuset name to move processes to

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -t THREAD-LIST, --threads THREAD-LIST β€” THREAD-LIST affected by commands (supports patterns)
  • -p PID-LIST, --pids PID-LIST β€” comma-separated list of PIDs to move

tuna cpuset show πŸ‘€

tuna-cmd.py cpuset show [-h] [--show-tasks] NAME

Show detailed information about a cpuset β€” the deep dive, the full lore πŸ“–

Positional arguments:

  • NAME β€” cpuset name to show

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • --show-tasks β€” show a detailed list of tasks/processes 🧡

tuna cpuset status πŸ“Š

tuna-cmd.py cpuset status [-h] [-p PATTERN] [--show-empty] [--no-recursive]

Show system-wide cpuset overview with statistics β€” the big picture, numbers included, we love data πŸ“ˆ

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -p PATTERN, --pattern PATTERN β€” filter by glob pattern (e.g., tuna*)
  • --show-empty β€” include cpusets with no CPUs assigned (default: skip empty)
  • --no-recursive β€” only show top-level cpusets

tuna cpuset modify πŸ”§

tuna-cmd.py cpuset modify [-h] [--add-cpus CPU-LIST] [--remove-cpus CPU-LIST] [-m MEM-NODES] [--isolated | --no-isolated] NAME

Modify an existing cpuset without destroying it β€” glow-up, not demolition πŸ’…

Positional arguments:

  • NAME β€” cpuset name to modify

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • --add-cpus CPU-LIST β€” CPUs to add to the cpuset (e.g., 4-7 or 4,5,6,7)
  • --remove-cpus CPU-LIST β€” CPUs to remove from the cpuset (e.g., 0-1 or 0,1)
  • -m MEM-NODES, --memory-nodes MEM-NODES β€” set memory nodes (e.g., "0" or "0-1")
  • --isolated β€” set the CPU partition to isolated
  • --no-isolated β€” set the CPU partition to member (not isolated)

tuna cpuset save πŸ’Ύ

tuna-cmd.py cpuset save [-h] [filename]

Save cpuset configuration to YAML profile β€” snapshot it, keep it forever, scrapbook behaviour πŸ“Έ

Positional arguments:

  • filename β€” output YAML file. The default path depends on execution context:
    • ./cpuset-profile.yaml when running from development (tuna-cmd.py)
    • /etc/tuna/cpuset-profile.yaml when running from production (tuna)

Optional arguments:

  • -h, --help β€” shows this help message and exits

tuna cpuset apply πŸͺ„

tuna-cmd.py cpuset apply [-h] [-v] [filename]

Apply cpuset configuration from YAML profile β€” load it back in and let it cook 🍳

Positional arguments:

  • filename β€” input YAML file. The default path depends on execution context:
    • ./cpuset-profile.yaml when running from development (tuna-cmd.py)
    • /etc/tuna/cpuset-profile.yaml when running from production (tuna)

Optional arguments:

  • -h, --help β€” shows this help message and exits
  • -v, --verbose β€” print detailed progress messages, narrate the whole journey πŸ—£οΈ

✨ MODIFIERS ✨

-c, --cpus=CPU-LIST

The CPU-LIST that gets affected by commands. It wants a CPU number, a range, or a comma-separated list of CPU numbers. So like, a single CPU, a lil range, or the whole lineup β€” your choice bestie πŸ’«

-S, --sockets=CPU-SOCKET-LIST

The CPU-SOCKET-LIST that gets affected by commands. It wants a socket number or a comma-separated list of socket numbers 🧦

-t, --threads=THREAD-LIST

The THREAD-LIST that gets affected by commands. It wants a thread number or a thread name, or a comma-separated list of thread numbers and/or names. Thread names may contain wildcards β€” and this is important, bestie β€” be sure to quote or escape any wildcard specifications, because your shell will absolutely snatch them up and eat them otherwise 😭

Wildcards are giving "I'll do it myself" if you don't quote or escape them. Quote them. Escape them. Protect them. 🫢
  • -q, --irqs=IRQ-LIST β€” this is the IRQ list that your commands are gonna mess with πŸ’… it wants an IRQ number, or an IRQ user name, or a whole comma-separated list mixing numbers and/or user names. IRQ user names can contain wildcards, bestie β€” so be sure to quote or escape any wildcard specs or your shell is gonna snatch them up before tuna ever sees them 😭

🌈 USAGE EXAMPLES 🌈

okay this is the part where it all clicks, fr fr. let's go ✨

πŸ’– CPU Affinity Examples πŸ’–

so like, say your Ethernet NICs have multiple queues for both receive and transmit, and each one has its own IRQ. then you can associate the Ethernet IRQs with a CPU socket, like this:

tuna isolate -S 2
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. iconic behavior tbh πŸ‘‘

πŸ¦‹ Cpuset Examples πŸ¦‹

create an isolated cpuset for real-time workloads:

tuna cpuset create -c 2-5 -n rt_workload -i

Create a cpuset named 'rt_workload' with CPUs 2-5, set to isolated partition. Memory nodes are auto-detected from CPU topology. no manual node-picking required, we love a self-sufficient queen πŸ’…

launch a real-time application in the rt_workload cpuset with FIFO scheduler and priority 80:

tuna run --cpuset rt_workload -p FIFO:80 'my_rt_app'

isolate CPUs using cpusets β€” and yes bestie, this is more powerful than traditional affinity:

tuna isolate -c 4-7 --cpuset my_isolated --cpuset-housekeeping my_hk 0-3

Isolate CPUs 4-7 by creating 'my_isolated' cpuset with kernel-enforced exclusivity (partition=isolated), and move all existing processes to 'my_hk' cpuset on CPUs 0-3 (partition=member). kernel-enforced?? she's literally doing the most and I'm obsessed 😌

move all kworker threads to the rt_workload cpuset:

tuna move --cpuset rt_workload -t 'kworker/*'

show only the processes running in the rt_workload cpuset:

tuna show_threads --cpuset rt_workload

add CPUs 6-7 to the rt_workload cpuset without disrupting running processes:

tuna cpuset modify rt_workload --add-cpus 6-7

display a system-wide overview of all cpusets with statistics:

tuna cpuset status

save the current cpuset configuration to a YAML profile:

tuna cpuset save /etc/tuna/my-rt-config.yaml
heads up bestie, the default path is different depending on how you're running it πŸ‘€ when you're running the installed version (tuna), the default path is /etc/tuna/cpuset-profile.yaml. when you're running from development (tuna-cmd.py), it defaults to ./cpuset-profile.yaml in the current directory. iykyk ✨

apply a previously saved cpuset configuration from a YAML profile:

tuna cpuset apply /etc/tuna/my-rt-config.yaml

Apply a previously saved cpuset configuration from a YAML profile. This recreates all cpusets defined in the profile with their CPU assignments, memory nodes, and partition settings. it just... puts it all back?? the way that this is basically a save point in a video game πŸŽ€


and that's the whole page, bestie!! 🫢 this is tuna, from the tuna source, dated July 2026 🌸 go forth and pin your IRQs, isolate your CPUs, and live your main character real-time-scheduling fantasy πŸ’–βœ¨ bye ily πŸ˜­πŸ’…

πŸ“¦ where this page comes from