[PATCH 3/5] tuna: Update man page for cpuset save/apply and recent changes

John Kacur <[email protected]> Tue, 28 Jul 2026 13:06:05 -0400
Newsgroups org.kernel.vger.linux-rt-users
Message-ID <[email protected]>
Update documentation to reflect recent cpuset enhancements:

- Add cpuset save and apply subcommands to the command list
- Document cpuset save with context-aware default paths
- Document cpuset apply with verbose option
- Update cpuset destroy to accept multiple names
- Fix housekeeping cpuset default: partition=member (was partition=isolated)
- Update isolate example to clarify partition types
- Add usage examples for save/apply commands

The context-aware paths are documented: ./cpuset-profile.yaml for
development (tuna-cmd.py) and /etc/tuna/cpuset-profile.yaml for
production (tuna).

Assisted-by: Claude:claude-sonnet-4-5
Signed-off-by: John Kacur <[email protected]>
---
 docs/tuna.8 | 52 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 7 deletions(-)

diff --git a/docs/tuna.8 b/docs/tuna.8
index 8d43c3ac73c8..7920ddfa7232 100644
--- a/docs/tuna.8
+++ b/docs/tuna.8
@@ -64,7 +64,7 @@ optional arguments:
                         partition=isolated)
   --cpuset-housekeeping [NAME] CPU-LIST
                         Create housekeeping cpuset: [NAME] CPU-LIST (default name:
-                        tuna_housekeeping, partition=isolated)
+                        tuna_housekeeping, partition=member)
 .TP
 \fBtuna include\fR
 usage: tuna-cmd.py include [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)
@@ -288,12 +288,12 @@ optional arguments:
   -K, --no_kthreads     Operations will not affect kernel threads
 .TP
 \fB tuna cpuset\fR
-usage: tuna-cmd.py cpuset [-h] {create,list,destroy,move,show,status,modify}
+usage: tuna-cmd.py cpuset [-h] {create,list,destroy,move,show,status,modify,save,apply}
 
 Manage CPU sets (cgroup v2). Cpusets provide fine-grained control over which CPUs processes can run on, with NUMA-aware memory node assignment and kernel-enforced isolation.
 
 subcommands:
-  {create,list,destroy,move,show,status,modify}
+  {create,list,destroy,move,show,status,modify,save,apply}
 
 .B tuna cpuset create
 usage: tuna-cmd.py cpuset create [-h] -c CPU-LIST [-n NAME] [-i]
@@ -327,13 +327,14 @@ optional arguments:
   --no-recursive        Only search top-level cpusets
 
 .B tuna cpuset destroy
-usage: tuna-cmd.py cpuset destroy [-h] [NAME] [-p PATTERN] [-f]
+usage: tuna-cmd.py cpuset destroy [-h] [-p PATTERN] [-f]
                                   [--include-empty] [--no-recursive]
+                                  [NAME ...]
 
-Destroy cpuset(s). Use either NAME or --pattern, not both.
+Destroy cpuset(s)
 
 positional arguments:
-  NAME                  Cpuset name to destroy (use this OR --pattern)
+  NAME                  Cpuset name(s) to destroy (one or more, OR use --pattern)
 
 optional arguments:
   -h, --help            show this help message and exit
@@ -404,6 +405,33 @@ optional arguments:
   --isolated            Set CPU partition to isolated
   --no-isolated         Set CPU partition to member (not isolated)
 
+.B tuna cpuset save
+usage: tuna-cmd.py cpuset save [-h] [filename]
+
+Save cpuset configuration to YAML profile
+
+positional arguments:
+  filename    Output YAML file. 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  show this help message and exit
+
+.B tuna cpuset apply
+usage: tuna-cmd.py cpuset apply [-h] [-v] [filename]
+
+Apply cpuset configuration from YAML profile
+
+positional arguments:
+  filename       Input YAML file. 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     show this help message and exit
+  -v, --verbose  Print detailed progress messages
+
 .IP \fIModifiers\fR
 .TP
 \fB\-c\fR, \fB\-\-cpus\fR=\fICPU\-LIST\fR
@@ -444,7 +472,7 @@ Isolate CPUs using cpusets (more powerful than traditional affinity):
 .TP
 .B 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, and move all existing processes to 'my_hk' cpuset on CPUs 0-3. Both cpusets use partition=isolated for kernel enforcement.
+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).
 
 .TP
 .B tuna move --cpuset rt_workload -t 'kworker/*'
@@ -465,3 +493,13 @@ Add CPUs 6-7 to the rt_workload cpuset without disrupting running processes.
 .B tuna cpuset status
 
 Display system-wide overview of all cpusets with statistics.
+
+.TP
+.B tuna cpuset save /etc/tuna/my-rt-config.yaml
+
+Save current cpuset configuration to a YAML profile. When running the installed version (tuna), the default path is /etc/tuna/cpuset-profile.yaml. When running from development (tuna-cmd.py), it defaults to ./cpuset-profile.yaml in the current directory.
+
+.TP
+.B 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.
-- 
2.55.0