Skip to contentSkip to conversation

tuna: Add cpuset save/apply functionality

PATCH New John Kacur 1 participant 8 messages Jul 16

lore
Share & tools
lore

John Kacur

author
#0 lore raw

cover tuna: Add cpuset save/apply functionality

This series adds save/apply functionality for cpuset configurations, allowing users to save their cpuset setup to YAML files and restore them after reboots or on other systems.

This builds on earlier cpuset integration work and addresses a common use case: making cpuset configurations reproducible and portable across systems. While the primary use case is RT workloads, the functionality is general-purpose and works for any cpuset-based CPU partitioning scenario.

Key features:
- Save cpuset definitions to YAML (name, CPUs, memory nodes, partition type)
- Apply profiles to recreate cpusets from YAML
- Automatic filtering of system cpusets (systemd slices/scopes/services)
- Idempotent application (warns if cpusets already exist)
- Full round-trip testing (save → destroy → apply → verify)

Example workflow:
# Set up cpusets for isolated workload tuna cpuset create -c 4-7 -n isolated --isolated tuna cpuset create -c 0-3 -n housekeeping

# Save configuration
tuna cpuset save my-config.yaml

# After reboot or on another system
tuna cpuset apply my-config.yaml -v

The series also includes some cleanup:
- Removes obsolete top-level 'apply' command (not cpuset-specific)
- Simplifies GUI sysctl configuration to monitoring-only
- Removes unused translation files (po/*.po)
- Fixes housekeeping cpuset default (partition=member is correct)
- Renames default profile file to cpuset-profile.yaml for clarity

Testing:
- 12 comprehensive test cases in tests/test_save_apply.py
- Tests cover: save/apply, round-trip, edge cases, error handling
- All tests require root (cpuset operations)
- Tested on Fedora with cgroup v2

John Kacur (7):
tuna: Add --show-system flag to filter systemd cpusets
tuna: Add cpuset save/apply functionality
tuna: Add comprehensive tests for save/apply functionality
tuna: Remove obsolete apply command functionality
tuna: Simplify GUI to monitoring-only functionality
tuna: Change housekeeping cpuset default to partition=member
tuna: Change default profile filename to cpuset-profile.yaml

 po/LINGUAS               |   3 -
 po/POTFILES.in           |  17 -
 po/ja.po                 | 718 ---------------------------------------
 po/pt_BR.po              | 634 ----------------------------------
 po/zh_CN.po              | 667 ------------------------------------
 tests/README.md          |  52 ++-
 tests/test_cpuset_cli.py |  30 +-
 tests/test_save_apply.py | 300 ++++++++++++++++
 tuna-cmd.py              | 247 +++++++-------
 tuna/config.py           |   2 -
 tuna/gui/profileview.py  |   4 +-
 tuna/profile.py          | 177 ++++++++++
 tuna/tuna_gui.glade      |   8 +-
 13 files changed, 661 insertions(+), 2198 deletions(-)
 delete mode 100644 po/LINGUAS
 delete mode 100644 po/POTFILES.in
 delete mode 100644 po/ja.po
 delete mode 100644 po/pt_BR.po
 delete mode 100644 po/zh_CN.po
 create mode 100644 tests/test_save_apply.py
 create mode 100644 tuna/profile.py
Signature · 1 line
2.55.0
author
#1 lore raw

PATCH 1/7 tuna: Add --show-system flag to filter systemd cpusets

Add ability to filter out systemd-managed cpusets from cpuset list and status commands. By default, system cpusets (.slice, .scope, .mount, .service) are now hidden as they are not relevant for RT tuning. Users can show them with --show-system flag.

Changes:
- Add skip_system parameter to get_all_cpusets_info()
- Add --show-system flag to 'cpuset list' and 'cpuset status'
- Refactor cpuset_list() to use centralized get_all_cpusets_info()
- Simplify blocklist checking to reuse data from get_all_cpusets_info()

This prepares for cpuset save/restore where we only want to save user-created cpusets, not systemd infrastructure.

Assisted-by Claude:claude-sonnet-4-5
---
 tuna-cmd.py | 114 ++++++++++++++++------------------------------------
 1 file changed, 35 insertions(+), 79 deletions(-)
tuna-cmd.py +35 -79
index 25257c465532..262159150211 100755
@@ -292,6 +292,7 @@ def gen_parser():
     cpuset_list.add_argument('-p', '--pattern', type=str, metavar='PATTERN', help='Filter by glob pattern (e.g., tuna*)')
     cpuset_list.add_argument('-v', '--verbose', action='store_true', help='Show detailed information (CPUs, tasks, partition type)')
     cpuset_list.add_argument('--show-empty', action='store_true', help='Include cpusets with no CPUs assigned (default: skip empty)')
+    cpuset_list.add_argument('--show-system', action='store_true', help='Include systemd-managed cpusets (default: skip system)')
     cpuset_list.add_argument('--no-recursive', dest='recursive', action='store_false', default=True, help='Only search top-level cpusets')
 
     # cpuset destroy
@@ -317,6 +318,7 @@ def gen_parser():
     cpuset_status = cpuset_subparser.add_parser('status', description='Show system-wide cpuset overview', help='Show cpuset status')
     cpuset_status.add_argument('-p', '--pattern', type=str, metavar='PATTERN', help='Filter by glob pattern (e.g., tuna*)')
     cpuset_status.add_argument('--show-empty', action='store_true', help='Include cpusets with no CPUs assigned (default: skip empty)')
+    cpuset_status.add_argument('--show-system', action='store_true', help='Include systemd-managed cpusets (default: skip system)')
     cpuset_status.add_argument('--no-recursive', dest='recursive', action='store_false', default=True, help='Only show top-level cpusets')
 
     # cpuset modify
@@ -984,13 +986,14 @@ def get_cpuset_info(cpuset_name):
     return info
 
 
-def get_all_cpusets_info(pattern=None, recursive=True, skip_empty=False):
+def get_all_cpusets_info(pattern=None, recursive=True, skip_empty=False, skip_system=False):
     """Get information about all cpusets matching criteria.
 
     Args:
         pattern: Glob pattern to filter cpusets (None for all)
         recursive: If True, search nested cpusets
         skip_empty: If True, skip cpusets with no CPUs assigned
+        skip_system: If True, skip systemd-managed cpusets (.slice, .scope, .mount, .service)
 
     Returns:
         list: List of cpuset info dictionaries (from get_cpuset_info)
@@ -998,6 +1001,9 @@ def get_all_cpusets_info(pattern=None, recursive=True, skip_empty=False):
     cpusets = cpuset.list_cpusets(pattern=pattern, recursive=recursive)
     infos = []
 
+    # System cpuset suffixes to filter
+    system_suffixes = ('.slice', '.scope', '.mount', '.service')
+
     for cs_name in cpusets:
         info = get_cpuset_info(cs_name)
 
@@ -1005,6 +1011,10 @@ def get_all_cpusets_info(pattern=None, recursive=True, skip_empty=False):
         if skip_empty and not info['cpus']:
             continue
 
+        # Skip system cpusets if requested
+        if skip_system and cs_name.endswith(system_suffixes):
+            continue
+
         infos.append(info)
 
     return infos
@@ -1056,13 +1066,14 @@ def cpuset_create(cpu_list, name, isolated, memory_nodes=None):
         sys.exit(1)
 
 
-def cpuset_list(pattern, verbose, show_empty, recursive):
+def cpuset_list(pattern, verbose, show_empty, show_system, recursive):
     """Handler for 'tuna cpuset list' command.
 
     Args:
         pattern: Glob pattern to filter cpusets (None for all)
         verbose: If True, show detailed info (CPUs, memory nodes, tasks, partition)
         show_empty: If True, show cpusets with no CPUs assigned (default: skip empty)
+        show_system: If True, show systemd-managed cpusets (default: skip system)
         recursive: If True, search nested cpusets
     """
     # Check cgroup v2 support
@@ -1071,25 +1082,11 @@ def cpuset_list(pattern, verbose, show_empty, recursive):
         print("Error: cgroup v2 cpusets not supported on this system", file=sys.stderr)
         sys.exit(1)
 
-    # List cpusets
-    cpusets = cpuset.list_cpusets(pattern=pattern, recursive=recursive)
-
-    # Filter out empty cpusets unless --show-empty was specified
-    if not show_empty:
-        filtered_cpusets = []
-        for cs_name in cpusets:
-            cs_path = os.path.join('/sys/fs/cgroup', cs_name)
-            try:
-                with open(os.path.join(cs_path, 'cpuset.cpus'), 'r', encoding='utf-8') as f:
-                    cpus = f.read().strip()
-                    if cpus:  # Only include if CPUs are assigned
-                        filtered_cpusets.append(cs_name)
-            except (OSError, IOError):
-                # If we can't read it, skip it
-                pass
-        cpusets = filtered_cpusets
+    # Get cpuset info using centralized function (skip_* params are inverse of show_*)
+    infos = get_all_cpusets_info(pattern=pattern, recursive=recursive,
+                                  skip_empty=not show_empty, skip_system=not show_system)
 
-    if not cpusets:
+    if not infos:
         if pattern:
             print(f"No cpusets found matching pattern '{pattern}'")
         else:
@@ -1101,64 +1098,21 @@ def cpuset_list(pattern, verbose, show_empty, recursive):
         print(f"{'NAME':<20} {'CPUS':<15} {'MEMS':<10} {'TASKS':<7} {'PARTITION':<10}")
         print("-" * 65)
 
-        for cs_name in cpusets:
-            cs_path = os.path.join('/sys/fs/cgroup', cs_name)
-
-            try:
-                # Read CPUs
-                with open(os.path.join(cs_path, 'cpuset.cpus'), 'r', encoding='utf-8') as f:
-                    cpus = f.read().strip() or "(none)"
-
-                # Read memory nodes
-                with open(os.path.join(cs_path, 'cpuset.mems'), 'r', encoding='utf-8') as f:
-                    mems = f.read().strip() or "(none)"
-
-                # Read tasks count
-                with open(os.path.join(cs_path, 'cgroup.procs'), 'r', encoding='utf-8') as f:
-                    tasks = [line.strip() for line in f if line.strip()]
-                    task_count = len(tasks)
-
-                # Read partition type (if available)
-                partition_file = os.path.join(cs_path, 'cpuset.cpus.partition')
-                if os.path.exists(partition_file):
-                    with open(partition_file, 'r', encoding='utf-8') as f:
-                        partition = f.read().strip()
-                else:
-                    partition = "n/a"
-
-                print(f"{cs_name:<20} {cpus:<15} {mems:<10} {task_count:<7} {partition:<10}")
-
-            except (OSError, IOError) as e:
-                print(f"{cs_name:<20} (error reading: {e})", file=sys.stderr)
+        for info in infos:
+            cpus = info['cpus'] or "(none)"
+            mems = info['mems'] or "(none)"
+            print(f"{info['name']:<20} {cpus:<15} {mems:<10} {info['task_count']:<7} {info['partition']:<10}")
     else:
         # Simple output: just names
-        for cs_name in cpusets:
-            print(cs_name)
+        for info in infos:
+            print(info['name'])
 
-    # Check for blocklisted processes in cpusets
-    # Skip system cgroups (*.mount, *.scope, *.slice) - these are managed by systemd
+    # Check for blocklisted processes (already collected by get_cpuset_info)
     warnings = []
-    for cs_name in cpusets:
-        # Skip system cgroups - only check user-created cpusets
-        if cs_name.endswith(('.mount', '.scope', '.slice')):
-            continue
-
-        cs_path = os.path.join('/sys/fs/cgroup', cs_name)
-        try:
-            with open(os.path.join(cs_path, 'cgroup.procs'), 'r', encoding='utf-8') as f:
-                pids = [line.strip() for line in f if line.strip()]
-                for pid_str in pids:
-                    try:
-                        pid = int(pid_str)
-                        if cpuset.Cpuset._is_process_blocklisted(pid):
-                            comm = cpuset.Cpuset._get_process_name(pid)
-                            warnings.append(f"⚠️  WARNING: Blocklisted process PID {pid} ({comm}) found in cpuset '{cs_name}'")
-                    except ValueError:
-                        # Invalid PID, skip
-                        pass
-        except (OSError, IOError):
-            # Can't read procs, skip
-            pass
+    for info in infos:
+        if info['blocklisted_pids']:
+            for pid, comm in info['blocklisted_pids']:
+                warnings.append(f"⚠️  WARNING: Blocklisted process PID {pid} ({comm}) found in cpuset '{info['name']}'")
 
     # Display warnings if any
     if warnings:
@@ -1385,12 +1339,13 @@ def cpuset_show(name, show_tasks):
         print("  These critical system processes should not be in custom cpusets!", file=sys.stderr)
 
 
-def cpuset_status(pattern, show_empty, recursive):
+def cpuset_status(pattern, show_empty, show_system, recursive):
     """Handler for 'tuna cpuset status' command.
 
     Args:
         pattern: Glob pattern to filter cpusets (None for all)
         show_empty: If True, show cpusets with no CPUs assigned (default: skip empty)
+        show_system: If True, show systemd-managed cpusets (default: skip system)
         recursive: If True, search nested cpusets
     """
     # Check cgroup v2 support
@@ -1399,8 +1354,9 @@ def cpuset_status(pattern, show_empty, recursive):
         print("Error: cgroup v2 cpusets not supported on this system", file=sys.stderr)
         sys.exit(1)
 
-    # Get all cpusets info (skip_empty is inverse of show_empty)
-    infos = get_all_cpusets_info(pattern=pattern, recursive=recursive, skip_empty=not show_empty)
+    # Get all cpusets info (skip_* params are inverse of show_*)
+    infos = get_all_cpusets_info(pattern=pattern, recursive=recursive,
+                                  skip_empty=not show_empty, skip_system=not show_system)
 
     if not infos:
         if pattern:
@@ -1901,7 +1857,7 @@ def main():
             cpuset_create(args.cpu_list, args.name, args.isolated, args.memory_nodes)
 
         elif args.cpuset_command == 'list':
-            cpuset_list(args.pattern, args.verbose, args.show_empty, args.recursive)
+            cpuset_list(args.pattern, args.verbose, args.show_empty, args.show_system, args.recursive)
 
         elif args.cpuset_command == 'destroy':
             cpuset_destroy(args.name, args.pattern, args.force, args.include_empty, args.recursive)
@@ -1913,7 +1869,7 @@ def main():
             cpuset_show(args.name, args.show_tasks)
 
         elif args.cpuset_command == 'status':
-            cpuset_status(args.pattern, args.show_empty, args.recursive)
+            cpuset_status(args.pattern, args.show_empty, args.show_system, args.recursive)
 
         elif args.cpuset_command == 'modify':
             # Parse CPU lists if provided
Signature · 1 line
2.55.0
author
#2 lore raw

PATCH 2/7 tuna: Add cpuset save/apply functionality

In reply to John Kacur

Implement save and apply commands as cpuset subcommands for cpuset configuration management, enabling users to save their cpuset setup to YAML and restore it later. This is useful for preserving RT isolation configurations across reboots or applying consistent setups across multiple systems.

Save functionality (tuna cpuset save):
- Saves all user-created cpusets to YAML profile
- Automatically filters out system cpusets (.slice, .scope, .mount, .service)
- Skips empty cpusets (no CPUs assigned)
- Captures: name, CPUs, memory nodes, partition type
- Default filename: tuna-profile.yaml

Apply functionality (tuna cpuset apply):
- Recreates cpusets from saved YAML profile
- Follows cgroup v2 requirements (memory nodes before CPUs)
- Non-destructive: warns when cpusets already exist instead of failing
- Supports verbose mode (-v) for detailed progress
- Returns statistics on applied/warnings/errors

Implementation details:
- Created tuna/profile.py module with save_cpusets() and apply_cpusets()
- Reuses existing get_all_cpusets_info() from tuna-cmd.py via parameter passing
- Passes cpuset module to apply function for code reuse
- Both commands check cgroup v2 support before proceeding
- Uses ruamel.yaml for human-readable YAML output
- Added save and apply as cpuset subcommands for consistency

Command structure:
tuna cpuset save [filename] # Save to file (default: tuna-profile.yaml)
tuna cpuset apply [filename] [-v] # Apply from file with optional verbose

Usage examples:

  tuna cpuset save my-config.yaml       # Save to custom file
  tuna cpuset apply my-config.yaml -v   # Apply with verbose output
  tuna cpuset save                      # Use default filename
  tuna cpuset apply                     # Apply default profile

This approach provides superior RT isolation by using kernel-enforced CPU partitioning via cgroups v2 rather than manual affinity settings.

Assisted-by Claude:claude-sonnet-4-5
---
 tuna-cmd.py     |  91 ++++++++++++++++++-------
 tuna/profile.py | 177 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 244 insertions(+), 24 deletions(-)
 create mode 100644 tuna/profile.py
tuna-cmd.py +67 -24
index 262159150211..4eba82aac412 100755
@@ -167,10 +167,6 @@ def gen_parser():
                                     help="Set thread scheduler tunables: POLICY and RTPRIO")
     run = subparser.add_parser('run', description="Fork a new process and run the COMMAND",
                                 help="Fork a new process and run the COMMAND")
-    save = subparser.add_parser('save', description="Save kthreads sched tunables to FILENAME",
-                                help="Save kthreads sched tunables to FILENAME")
-    # apply = subparser.add_parser('apply', description="Apply changes described in profile",
-    #                             help="Apply changes described in profile")
     show_threads = subparser.add_parser('show_threads', description='Show thread list', help='Show thread list')
     show_irqs = subparser.add_parser('show_irqs', description='Show IRQ list', help='Show IRQ list')
     show_configs = subparser.add_parser('show_configs', description='List preloaded profiles', help='List preloaded profiles')
@@ -225,15 +221,6 @@ def gen_parser():
     run.add_argument('-p', '--priority', **MODS['priority'])
     run.add_argument('-b', '--background', **MODS['background'])
 
-    save.add_argument('filename', **POS['filename'])
-    save_group = save.add_mutually_exclusive_group(required=False)
-    save_group.add_argument('-c', '--cpus', **MODS['cpus'])
-    save_group.add_argument('-S', '--sockets', **MODS['sockets'])
-    save_group.add_argument('-N', '--nohz_full', **MODS['nohz_full'])
-    save.add_argument('-t', '--threads', **MODS['threads'])
-
-    # apply.add_argument('profilename', **POS['profilename'])
-
     show_threads_group1 = show_threads.add_mutually_exclusive_group(required=False)
     show_threads_group1.add_argument('-c', '--cpus', **MODS['cpus'])
     show_threads_group1.add_argument('-N', '--nohz_full', **MODS['nohz_full'])
@@ -334,6 +321,18 @@ def gen_parser():
     partition_group.add_argument('--isolated', action='store_true', help='Set CPU partition to isolated')
     partition_group.add_argument('--no-isolated', action='store_true', help='Set CPU partition to member (not isolated)')
 
+    # cpuset save
+    cpuset_save = cpuset_subparser.add_parser('save', description='Save cpuset configuration to YAML profile', help='Save cpuset configuration')
+    cpuset_save.add_argument('filename', nargs='?', default='tuna-profile.yaml',
+                             help='Output YAML file (default: tuna-profile.yaml)')
+
+    # cpuset apply
+    cpuset_apply = cpuset_subparser.add_parser('apply', description='Apply cpuset configuration from YAML profile', help='Apply cpuset configuration')
+    cpuset_apply.add_argument('filename', nargs='?', default='tuna-profile.yaml',
+                              help='Input YAML file (default: tuna-profile.yaml)')
+    cpuset_apply.add_argument('-v', '--verbose', action='store_true',
+                              help='Print detailed progress messages')
+
     return parser
 
 
@@ -351,14 +350,55 @@ def thread_help(tid, ps):
     print(help)
 
 
-def save(cpu_list, thread_list, filename):
-    kthreads = tuna.get_kthread_sched_tunings()
-    for name in list(kthreads.keys()):
-        kt = kthreads[name]
-        if (cpu_list and not set(kt.affinity).intersection(set(cpu_list))) or \
-           (thread_list and kt.pid not in thread_list):
-            del kthreads[name]
-    tuna.generate_rtgroups(filename, kthreads, utils.get_nr_cpus())
+def save_cpusets_cmd(filename):
+    """Handler for 'tuna cpuset save' command - saves cpuset configuration to YAML.
+
+    Args:
+        filename: Output YAML file path
+    """
+    from tuna import profile
+
+    # Check cgroup v2 support
+    ci = cpuset.CpusetsInit()
+    if not ci.supported:
+        print("Error: cgroup v2 cpusets not supported on this system", file=sys.stderr)
+        sys.exit(1)
+
+    # Save cpusets using profile module (reuses get_all_cpusets_info)
+    num_saved = profile.save_cpusets(filename, get_all_cpusets_info)
+
+    if num_saved > 0:
+        print(f"Saved {num_saved} cpuset(s) to {filename}")
+    else:
+        print("No cpusets to save", file=sys.stderr)
+
+
+def apply_cpusets_cmd(filename, verbose=False):
+    """Handler for 'tuna cpuset apply' command - applies cpuset configuration from YAML.
+
+    Args:
+        filename: Input YAML file path
+        verbose: If True, print detailed progress messages
+    """
+    from tuna import profile
+
+    # Check cgroup v2 support
+    ci = cpuset.CpusetsInit()
+    if not ci.supported:
+        print("Error: cgroup v2 cpusets not supported on this system", file=sys.stderr)
+        sys.exit(1)
+
+    # Apply cpusets using profile module (passes cpuset module for code reuse)
+    num_applied, num_warnings, num_errors = profile.apply_cpusets(filename, cpuset, verbose)
+
+    # Print summary
+    if num_applied > 0:
+        print(f"Applied {num_applied} cpuset(s) from {filename}")
+    if num_warnings > 0:
+        print(f"Warnings: {num_warnings}", file=sys.stderr)
+    if num_errors > 0:
+        print(f"Errors: {num_errors}", file=sys.stderr)
+        sys.exit(1)
 
 
 def extract_cpuset_name(cgroup_path):
@@ -1814,9 +1854,6 @@ def main():
             if args.irq_list:
                 tuna.move_irqs_to_cpu(args.cpu_list, args.irq_list, spread=spread)
 
-    elif args.command in ['s', 'save']:
-        save(args.cpu_list, args.thread_list, args.filename)
-
     elif args.command in ['W', 'what_is']:
         if not ps:
             ps = procfs.pidstats()
@@ -1883,6 +1920,12 @@ def main():
             cpuset_modify(args.name, add_cpus, remove_cpus, args.memory_nodes,
                          args.isolated, args.no_isolated)
 
+        elif args.cpuset_command == 'save':
+            save_cpusets_cmd(args.filename)
+
+        elif args.cpuset_command == 'apply':
+            apply_cpusets_cmd(args.filename, args.verbose)
+
 
 if __name__ == '__main__':
     main()
tuna/profile.py new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.55.0
author
#3 lore raw

PATCH 3/7 tuna: Add comprehensive tests for save/apply functionality

In reply to John Kacur

Add Python test suite for cpuset save/apply subcommands with 12 test cases covering all functionality and edge cases.

Test coverage (tests/test_save_apply.py):
- test_save_creates_yaml_file: Verify save creates output file
- test_save_captures_all_cpusets: Verify all user cpusets are saved
- test_save_captures_partition_types: Verify isolated vs member preserved
- test_save_captures_cpu_ranges: Verify CPU assignments preserved
- test_apply_recreates_cpusets: Verify apply recreates from YAML
- test_apply_preserves_partition_types: Verify partition types restored
- test_apply_preserves_cpu_assignments: Verify CPU assignments restored
- test_apply_with_existing_cpusets_warns: Verify idempotent operation
- test_apply_missing_file_returns_error: Error handling for missing files
- test_roundtrip_preserves_configuration: Full save→destroy→apply→verify
- test_save_with_no_cpusets: Handle empty cpuset case gracefully
- test_save_skips_system_cpusets: Verify system cpuset filtering

Test structure:
- Uses unittest framework (consistent with existing tests)
- Requires root permissions (@skipUnless decorator)
- Requires cgroup v2 support (@skipUnless decorator)
- setUp/tearDown for cleanup (creates temp files, cleans cpusets)
- Cleans up test cpusets from both automated and manual testing
- Helper method create_test_cpusets() for test data
- Uses tempfile module for safe YAML file handling

All tests follow the same pattern as existing cpuset tests in test_cpuset.py and test_cpuset_cli.py, ensuring consistency across the test suite.

Tests can be run with:
sudo python3 -m unittest tests.test_save_apply -v

Assisted-by Claude:claude-sonnet-4-5
---
 tests/README.md          |  37 +++--
 tests/test_save_apply.py | 300 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 327 insertions(+), 10 deletions(-)
 create mode 100644 tests/test_save_apply.py
tests/README.md +27 -10
index 3e8b84a81fd4..1b96a54807f9 100644
@@ -12,7 +12,7 @@ This directory contains the test suite for tuna, using Python's `unittest` frame
 # Run all non-root tests only (45 tests)
 make tests
 
-# Run ALL tests (all 146 tests, requires sudo for root-required tests)
+# Run ALL tests (all 158 tests, requires sudo for root-required tests)
 make test-all
 
 # Run specific test module
@@ -37,7 +37,7 @@ make tests
 # or
 make unit-tests
 
-# Using make (ALL tests including root-required tests, 146 tests)
+# Using make (ALL tests including root-required tests, 158 tests)
 make test-all
 
 # Using the test runner directly (non-root tests only)
@@ -168,7 +168,7 @@ Tests are organized using Python's `unittest` framework. Each test file contains
   - Tests edge cases: empty string and None inputs
   - Run: `python3 -m unittest tests.test_show_threads_cgroups.TestExtractCpusetName -v`
 
-#### Root-Required Tests (102 tests)
+#### Root-Required Tests (114 tests)
 
 - **test_process_blocklist.py** (2 tests) - Process blocklist root tests
   - Tests actual blocking of systemd from being moved to cpusets
@@ -226,7 +226,23 @@ Tests are organized using Python's `unittest` framework. Each test file contains
     - test_cgroups_displays_system_slice_shortened: Verifies system.slice shows shortened name
   - Run: `sudo python3 -m unittest tests.test_show_threads_cgroups.TestShowThreadsCgroupsDisplay -v`
 
-**Total: 146 tests** (45 non-root + 101 root-required)
+- **test_save_apply.py** (12 tests) - save/apply cpuset configuration tests
+  - TestSaveApply: Tests cpuset save and apply functionality
+    - test_save_creates_yaml_file: Verify save creates output file
+    - test_save_captures_all_cpusets: Verify all user cpusets are saved
+    - test_save_captures_partition_types: Verify isolated vs member preserved
+    - test_save_captures_cpu_ranges: Verify CPU assignments preserved
+    - test_apply_recreates_cpusets: Verify apply recreates from YAML
+    - test_apply_preserves_partition_types: Verify partition types restored
+    - test_apply_preserves_cpu_assignments: Verify CPU assignments restored
+    - test_apply_with_existing_cpusets_warns: Verify idempotent operation
+    - test_apply_missing_file_returns_error: Error handling for missing files
+    - test_roundtrip_preserves_configuration: Full save→destroy→apply→verify
+    - test_save_with_no_cpusets: Handle empty cpuset case gracefully
+    - test_save_skips_system_cpusets: Verify system cpuset filtering
+  - Run: `sudo python3 -m unittest tests.test_save_apply -v`
+
+**Total: 158 tests** (45 non-root + 113 root-required)
 
 ### Test Requirements: Root vs Non-Root
 
@@ -275,7 +291,7 @@ These tests run without root privileges:
 - Tests are fast and don't affect the running system
 - Tests verify both happy path (with mocks) and error path (with real EPERM)
 
-#### Root-Required Tests (102 tests)
+#### Root-Required Tests (114 tests)
 
 These tests require root to create/manipulate cgroups:
 
@@ -446,9 +462,9 @@ Ran 45 tests in 0.XXXs
 OK (skipped=102)
 ```
 
-### All Tests Including Root-Required (146 tests)
+### All Tests Including Root-Required (158 tests)
 
-Running with sudo will run all 146 tests:
+Running with sudo will run all 158 tests:
 
 ```bash
 $ sudo python3 -m unittest discover -s tests -p "test_*.py" -v
@@ -463,7 +479,7 @@ test_sequential_naming (test_cpuset_cli.TestGetNextTunaCpusetName) ... ok
 ... (4 show_threads -G display tests)
 
 ----------------------------------------------------------------------
-Ran 146 tests in X.XXXs
+Ran 158 tests in X.XXXs
 
 OK
 ```
@@ -480,12 +496,13 @@ The test suite includes:
 - **show_threads --cpuset help test**: CLI documentation verification (read-only)
 - **Cpuset name extraction tests**: Cgroup path parsing logic (pure function testing)
 
-### Integration Tests (102 tests - require root)
+### Integration Tests (114 tests - require root)
 - **Process blocklist tests**: Test blocklist protection (2 root-required tests)
 - **Cpuset module tests**: Test interaction with cgroup v2 subsystem
 - **Cpuset CLI tests**: Test command-line interface integration
 - **show_threads --cpuset tests**: Test process filtering by cpuset membership
 - **show_threads -G display tests**: Test cpuset name display in cgroups output
+- **Save/apply tests**: Test cpuset configuration save and restore functionality
 
 Future test categories might include:
 - **System tests** - Full end-to-end tests requiring CPU affinity operations
@@ -510,7 +527,7 @@ python3 -m unittest discover -s tests -p "test_*.py" -v
 
 ### Root-Required Tests (Optional for CI)
 
-The cpuset tests (102 tests) can run in CI with special setup:
+The cpuset tests (114 tests) can run in CI with special setup:
 - Requires root access or privileged containers
 - Requires cgroup v2 support
 - May need dedicated test runners with appropriate permissions
tests/test_save_apply.py new file +300 -0

300 lines not on this page · raw message

Signature · 1 line
2.55.0
author
#4 lore raw

PATCH 4/7 tuna: Remove obsolete apply command functionality

In reply to John Kacur

Remove the broken apply command infrastructure that was disabled in commit 959a16ce. The apply functionality conflicts with the recommended tuned-based workflow for sysctl profile management.

Removed:
- apply_config() function (only called from commented-out code)
- Commented-out apply command handler
- Unused "profilename" argument definition
- Debug print statement in config.py
- Unreachable comment after raise statement

Assisted-by Claude:claude-sonnet-4-5
---
 tuna-cmd.py    | 28 ----------------------------
 tuna/config.py |  2 --
 2 files changed, 30 deletions(-)
tuna-cmd.py +0 -28
index 4eba82aac412..b78837c614e5 100755
@@ -111,7 +111,6 @@ def gen_parser():
             "cpu_list": dict(metavar='CPU-LIST', type=tuna.cpustring_to_list, help="CPU-LIST affected by commands"),
             "thread_list": dict(metavar='THREAD-LIST', nargs='+', help="THREAD-LIST affected by commands"),
             "filename": dict(metavar='FILENAME', type=str, help="Save kthreads sched tunables to this file"),
-            "profilename": dict(type=str, help="Apply changes described in this file"),
             "run_command": dict(metavar='COMMAND', type=str, help="fork a new process and run the \"COMMAND\""),
             "priority": dict(type=tuna.get_policy_and_rtprio, metavar="POLICY:RTPRIO", help="Set thread scheduler tunables: POLICY and RTPRIO"),
           }
@@ -887,30 +886,6 @@ def i18n_init():
     gettext.install(app, localedir)
 
 
-def apply_config(filename):
-    from tuna.config import Config
-    config = Config()
-    if os.path.exists(filename):
-        config.config['root'] = os.getcwd() + "/"
-        filename = os.path.basename(filename)
-    else:
-        if not os.path.exists(config.config['root']+filename):
-            print(filename + _(" not found!"))
-            sys.exit(1)
-    if config.loadTuna(filename):
-        sys.exit(1)
-    ctrl = 0
-    values = {}
-    values['toapply'] = {}
-    for index in range(len(config.ctlParams)):
-        for opt in config.ctlParams[index]:
-            values['toapply'][ctrl] = {}
-            values['toapply'][ctrl]['label'] = opt
-            values['toapply'][ctrl]['value'] = config.ctlParams[index][opt]
-            ctrl = ctrl + 1
-    config.applyChanges(values)
-
-
 def list_config():
     from tuna.config import Config
     config = Config()
@@ -1661,9 +1636,6 @@ def main():
                         print(f"[ERROR] Invalid RT priority: {rtprio}. RT priorities must be 1-99", file=sys.stderr)
                         sys.exit(2)
 
-    # if args.command in ['apply', 'a']:
-    #     apply_config(args.profilename)
-
     if args.command in ['include', 'I']:
         tuna.include_cpus(args.cpu_list, utils.get_nr_cpus())
 
tuna/config.py +0 -2
index 63c9f23bb09b..7f0df96fa655 100644
@@ -112,7 +112,6 @@ class Config:
         if profile[1]:
             raise RuntimeError(
                 _("Can't activate tuna profile in tuned daemon\n%s" % profile[1]))
-            # return False - unreachable code here!
         if not os.path.exists(ldir):
             try:
                 os.stat(ldir)
@@ -150,7 +149,6 @@ class Config:
         return True
 
     def loadTuna(self, profileName):
-        print(f'profileName = {profileName}')   # REMOVE
         err = self.checkConfigFile(self.config['root'] + profileName)
         if err != '':
             raise RuntimeError(_("Config file contain errors: ") + _(err))
Signature · 1 line
2.55.0
author
#5 lore raw

PATCH 5/7 tuna: Simplify GUI to monitoring-only functionality

In reply to John Kacur

Hide the obsolete Profile management and Profile editing tabs. These tabs provided sysctl tuning which is better handled by tuned. The GUI now focuses on its core value: monitoring threads, IRQs, and CPU usage.

Also fix runtime issues and remove outdated translations:
- Disable IBUS to avoid ownership warnings
- Force English locale and remove outdated po/ translation files
- Translation files can be regenerated when GUI is redesigned

Assisted-by Claude:claude-sonnet-4-5
---
 po/LINGUAS              |   3 -
 po/POTFILES.in          |  17 -
 po/ja.po                | 718 ----------------------------------------
 po/pt_BR.po             | 634 -----------------------------------
 po/zh_CN.po             | 667 -------------------------------------
 tuna-cmd.py             |   6 +
 tuna/gui/profileview.py |   4 +-
 tuna/tuna_gui.glade     |   8 +-
 8 files changed, 12 insertions(+), 2045 deletions(-)
 delete mode 100644 po/LINGUAS
 delete mode 100644 po/POTFILES.in
 delete mode 100644 po/ja.po
 delete mode 100644 po/pt_BR.po
 delete mode 100644 po/zh_CN.po
po/LINGUAS deleted +0 -3
deleted file mode 100644
index aca7c86bce55..000000000000
@@ -1,3 +0,0 @@
-pt_BR
-ja
-zh_CN
po/POTFILES.in deleted +0 -17
deleted file mode 100644
index be8ec2edac1a..000000000000
@@ -1,17 +0,0 @@
-tuna/__init__.py
-tuna/tuna_gui.glade
-tuna/tuna_gui.py
-tuna/sysfs.py
-tuna/oscilloscope.py
-tuna/tuna.py
-tuna/help.py
-tuna/config.py
-tuna/gui/__init__.py
-tuna/gui/util.py
-tuna/gui/cpuview.py
-tuna/gui/procview.py
-tuna/gui/irqview.py
-tuna/gui/profileview.py
-tuna/gui/commonview.py
-tuna-cmd.py
-oscilloscope-cmd.py
po/ja.po deleted +0 -718

718 lines not on this page · raw message

po/pt_BR.po deleted +0 -634

634 lines not on this page · raw message

po/zh_CN.po deleted +0 -667

667 lines not on this page · raw message

tuna-cmd.py +6 -0
index b78837c614e5..5e88ed252575 100755
@@ -1842,6 +1842,12 @@ def main():
             parser.print_help()
             return
 
+        # Disable IBUS to avoid warnings when running as root
+        os.environ['GTK_IM_MODULE'] = 'gtk-im-context-simple'
+
+        # Disable translations - po files are outdated and GUI is being redesigned
+        os.environ['LANGUAGE'] = 'C'
+
         try:
             from tuna import tuna_gui
         except ImportError:
tuna/gui/profileview.py +2 -2
index e5022b8b6dc1..4894ff6c2727 100644
@@ -134,7 +134,7 @@ class profileview:
             if not self.config.loadDirect(self.temp):
                 self.commonview.updateCommonView()
                 self.config.updateDefault(self.config.cacheFileName)
-                self.frame.show()
+                # self.frame.show()  # Disabled - Profile management tab hidden
             else:
                 self.frame.hide()
         except RuntimeError as e:
@@ -151,7 +151,7 @@ class profileview:
                     if val[0] == self.config.config['lastfile']:
                         self.configFileTree.set_cursor(val.path[0])
                 self.commonview.updateCommonView()
-                self.frame.show()
+                # self.frame.show()  # Disabled - Profile management tab hidden
             else:
                 self.frame.hide()
         except RuntimeError as e:
tuna/tuna_gui.glade +4 -4
index 1ddcf12c6b55..28c37009ad2b 100644
@@ -141,7 +141,7 @@
             </child>
             <child>
               <object class="GtkScrolledWindow" id="TunableFramesw">
-                <property name="visible">True</property>
+                <property name="visible">False</property>
                 <property name="can_focus">True</property>
                 <child>
                   <object class="GtkViewport" id="TunableFrame">
@@ -456,7 +456,7 @@
             </child>
             <child type="tab">
               <object class="GtkLabel" id="common_tab_l">
-                <property name="visible">True</property>
+                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Profile management</property>
               </object>
@@ -467,7 +467,7 @@
             </child>
             <child>
               <object class="GtkFrame" id="profile_frame">
-                <property name="visible">True</property>
+                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <child>
@@ -758,7 +758,7 @@
             </child>
             <child type="tab">
               <object class="GtkLabel" id="profile_tab_l">
-                <property name="visible">True</property>
+                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Profile editing</property>
               </object>
Signature · 1 line
2.55.0
author
#6 lore raw

PATCH 6/7 tuna: Change housekeeping cpuset default to partition=member

In reply to John Kacur

Change the default partition type for housekeeping cpusets from 'isolated' to 'member', aligning with rteval's design. In rteval, housekeeping cpusets use partition=member while only the measurement cpuset uses partition=isolated.

This change makes tuna's behavior consistent with rteval for users who are familiar with both tools.

Add a new --housekeeping-isolated flag to allow users to override the default and create housekeeping cpusets with partition=isolated if desired.

Updated tests to reflect the new behavior:
- Fixed two existing tests to expect partition=member for housekeeping
- Added test_isolate_housekeeping_isolated_flag to verify the new flag works
- Updated tests/README.md to document the changes (159 total tests now)

Assisted-by Claude:claude-sonnet-4-5
---
 tests/README.md          | 27 +++++++++++++++------------
 tests/test_cpuset_cli.py | 30 ++++++++++++++++++++++++++++--
 tuna-cmd.py              |  8 ++++++--
 3 files changed, 49 insertions(+), 16 deletions(-)
tests/README.md +15 -12
index 1b96a54807f9..073f79837196 100644
@@ -12,7 +12,7 @@ This directory contains the test suite for tuna, using Python's `unittest` frame
 # Run all non-root tests only (45 tests)
 make tests
 
-# Run ALL tests (all 158 tests, requires sudo for root-required tests)
+# Run ALL tests (all 159 tests, requires sudo for root-required tests)
 make test-all
 
 # Run specific test module
@@ -37,7 +37,7 @@ make tests
 # or
 make unit-tests
 
-# Using make (ALL tests including root-required tests, 158 tests)
+# Using make (ALL tests including root-required tests, 159 tests)
 make test-all
 
 # Using the test runner directly (non-root tests only)
@@ -186,7 +186,7 @@ Tests are organized using Python's `unittest` framework. Each test file contains
   - Note: TestCpusetsInit (5 tests) and TestNumaDetection (6 tests) run without root, see non-root section
   - Run: `sudo python3 -m unittest tests.test_cpuset -v` (runs all 43 tests with root)
 
-- **test_cpuset_cli.py** (50 tests) - CLI command tests
+- **test_cpuset_cli.py** (51 tests) - CLI command tests
   - TestGetNextTunaCpusetName: Auto-naming logic (tuna0, tuna1, gap-filling)
   - TestCpusetCreateCLI: Create command with auto/custom names, --isolated, and NUMA auto-detection/override
   - TestCpusetListCLI: List command with --pattern, --verbose, --skip-empty
@@ -196,9 +196,11 @@ Tests are organized using Python's `unittest` framework. Each test file contains
   - TestCpusetStatusCLI: Status command for system-wide cpuset overview
   - TestCpusetModifyCLI: Modify command with --add-cpus, --remove-cpus, --memory-nodes, --isolated/--no-isolated
   - TestTunaMoveCpusetCLI: Integration of --cpuset with tuna move command (5 tests)
-  - TestTunaIsolateCpusetCLI: Integration of --cpuset with tuna isolate command (8 tests)
+  - TestTunaIsolateCpusetCLI: Integration of --cpuset with tuna isolate command (9 tests)
     - Tests cpuset-based CPU isolation with isolated and housekeeping cpusets
-    - Verifies partition types, CPU assignments, and process migration
+    - Verifies partition types: isolated cpuset uses partition=isolated, housekeeping uses partition=member by default
+    - Tests --housekeeping-isolated flag to override default and make housekeeping partition=isolated
+    - Verifies CPU assignments and process migration
     - Tests error handling and backward compatibility
   - TestTunaRunCpusetCLI: Integration of --cpuset with tuna run command (5 tests)
     - test_run_with_cpuset_basic: Verifies running commands in cpusets
@@ -242,7 +244,7 @@ Tests are organized using Python's `unittest` framework. Each test file contains
     - test_save_skips_system_cpusets: Verify system cpuset filtering
   - Run: `sudo python3 -m unittest tests.test_save_apply -v`
 
-**Total: 158 tests** (45 non-root + 113 root-required)
+**Total: 159 tests** (45 non-root + 114 root-required)
 
 ### Test Requirements: Root vs Non-Root
 
@@ -301,7 +303,7 @@ These tests require root to create/manipulate cgroups:
    - Test task migration between cpusets
    - All tests clean up created cpusets in tearDown()
 
-2. **Cpuset CLI tests** (50 tests) test command-line interface functions
+2. **Cpuset CLI tests** (51 tests) test command-line interface functions
    - Test cpuset create/list/destroy/move/show/status/modify commands
    - Verify auto-naming logic (tuna0, tuna1, etc.)
    - Test NUMA-aware memory node auto-detection and manual override
@@ -309,7 +311,8 @@ These tests require root to create/manipulate cgroups:
    - Test process migration with --pids and --threads
    - Test cpuset modification with --add-cpus, --remove-cpus, --memory-nodes, --isolated
    - Test tuna move --cpuset integration (5 tests)
-   - Test tuna isolate --cpuset integration (8 tests) - cpuset-based CPU isolation
+   - Test tuna isolate --cpuset integration (9 tests) - cpuset-based CPU isolation
+   - Test --housekeeping-isolated flag to override default partition=member for housekeeping
    - Test tuna run --cpuset integration (5 tests) - running commands in cpusets
    - All tests clean up created cpusets afterwards
 
@@ -462,9 +465,9 @@ Ran 45 tests in 0.XXXs
 OK (skipped=102)
 ```
 
-### All Tests Including Root-Required (158 tests)
+### All Tests Including Root-Required (159 tests)
 
-Running with sudo will run all 158 tests:
+Running with sudo will run all 159 tests:
 
 ```bash
 $ sudo python3 -m unittest discover -s tests -p "test_*.py" -v
@@ -474,12 +477,12 @@ test_cpuset_path (test_cpuset.TestCpusetsInit) ... ok
 ... (32 cpuset module tests)
 test_first_name_is_tuna0 (test_cpuset_cli.TestGetNextTunaCpusetName) ... ok
 test_sequential_naming (test_cpuset_cli.TestGetNextTunaCpusetName) ... ok
-... (50 cpuset CLI tests)
+... (51 cpuset CLI tests)
 ... (6 show_threads --cpuset tests)
 ... (4 show_threads -G display tests)
 
 ----------------------------------------------------------------------
-Ran 158 tests in X.XXXs
+Ran 159 tests in X.XXXs
 
 OK
 ```
tests/test_cpuset_cli.py +28 -2
index c95cea29b4a3..619c719094ac 100644
@@ -1018,6 +1018,7 @@ class TestTunaIsolateCpusetCLI(unittest.TestCase):
         try:
             cpuset.cleanup_cpusets('tuna_*', force=True, recursive=False)
             cpuset.cleanup_cpusets('my_*', force=True, recursive=False)
+            cpuset.cleanup_cpusets('test_*', force=True, recursive=False)
         except:
             pass
 
@@ -1027,6 +1028,7 @@ class TestTunaIsolateCpusetCLI(unittest.TestCase):
         try:
             cpuset.cleanup_cpusets('tuna_*', force=True, recursive=False)
             cpuset.cleanup_cpusets('my_*', force=True, recursive=False)
+            cpuset.cleanup_cpusets('test_*', force=True, recursive=False)
         except:
             pass
 
@@ -1114,7 +1116,7 @@ class TestTunaIsolateCpusetCLI(unittest.TestCase):
 
         with open(f'{hk_path}/cpuset.cpus.partition') as f:
             partition = f.read().strip()
-            self.assertEqual(partition, 'isolated')
+            self.assertEqual(partition, 'member')
 
         # Verify processes were migrated to housekeeping
         with open(f'{hk_path}/cgroup.procs') as f:
@@ -1152,11 +1154,35 @@ class TestTunaIsolateCpusetCLI(unittest.TestCase):
             self.assertIn('2', cpus)
             self.assertIn('3', cpus)
 
-        # Both should be isolated partitions
+        # Verify partition types: isolated cpuset should be 'isolated', housekeeping should be 'member'
         with open('/sys/fs/cgroup/my_rt/cpuset.cpus.partition') as f:
             self.assertEqual(f.read().strip(), 'isolated')
 
         with open('/sys/fs/cgroup/my_hk/cpuset.cpus.partition') as f:
+            self.assertEqual(f.read().strip(), 'member')
+
+    def test_isolate_housekeeping_isolated_flag(self):
+        """Test --housekeeping-isolated flag makes housekeeping partition=isolated"""
+        result = subprocess.run([
+            sys.executable, './tuna-cmd.py', 'isolate',
+            '-c', '0-1', '--cpuset', 'test_iso',
+            '--cpuset-housekeeping', 'test_hk_iso', '2-3',
+            '--housekeeping-isolated'
+        ], capture_output=True, text=True)
+
+        self.assertEqual(result.returncode, 0, f"Command failed: {result.stderr}")
+        self.assertIn('test_iso', result.stdout)
+        self.assertIn('test_hk_iso', result.stdout)
+
+        # Verify both cpusets exist
+        self.assertTrue(os.path.exists('/sys/fs/cgroup/test_iso'))
+        self.assertTrue(os.path.exists('/sys/fs/cgroup/test_hk_iso'))
+
+        # Both should have partition=isolated when --housekeeping-isolated is used
+        with open('/sys/fs/cgroup/test_iso/cpuset.cpus.partition') as f:
+            self.assertEqual(f.read().strip(), 'isolated')
+
+        with open('/sys/fs/cgroup/test_hk_iso/cpuset.cpus.partition') as f:
             self.assertEqual(f.read().strip(), 'isolated')
 
     def test_isolate_housekeeping_without_cpuset_error(self):
tuna-cmd.py +6 -2
index 5e88ed252575..3d4414d93d0e 100755
@@ -181,7 +181,9 @@ def gen_parser():
                         metavar='NAME', default=None,
                         help='Use cpusets for isolation with optional name (default: tuna_isolated, partition=isolated)')
     isolate.add_argument('--cpuset-housekeeping', nargs='+', metavar='...',
-                        help='Create housekeeping cpuset: [NAME] CPU-LIST (default name: tuna_housekeeping, partition=isolated)')
+                        help='Create housekeeping cpuset: [NAME] CPU-LIST (default name: tuna_housekeeping, partition=member)')
+    isolate.add_argument('--housekeeping-isolated', action='store_true',
+                        help='Make housekeeping cpuset use partition=isolated instead of member (requires --cpuset-housekeeping)')
 
     include_group = include.add_mutually_exclusive_group(required=True)
     include_group.add_argument('-c', '--cpus', **MODS['cpus'])
@@ -1694,7 +1696,9 @@ def main():
                     hk_cpuset = cpuset.Cpuset(housekeeping_name)
                     hk_cpuset.write_memnode(hk_numa)
                     hk_cpuset.assign_cpus(housekeeping_cpus)
-                    hk_cpuset.write_cpu_exclusive(True)  # partition=isolated
+                    # Default to partition=member (False) unless --housekeeping-isolated specified
+                    hk_isolated = getattr(args, 'housekeeping_isolated', False)
+                    hk_cpuset.write_cpu_exclusive(hk_isolated)
 
                     # Migrate processes from root to housekeeping
                     print(f"Migrating processes to housekeeping cpuset...")
Signature · 1 line
2.55.0
author
#7 lore raw

PATCH 7/7 tuna: Change default profile filename to cpuset-profile.yaml

In reply to John Kacur

The default filename for cpuset save/apply operations has been changed from tuna-profile.yaml to cpuset-profile.yaml. This better reflects the specific content of the profile file, which contains only cpuset configuration data.

This change affects:
- tuna cpuset save (default output: cpuset-profile.yaml)
- tuna cpuset apply (default input: cpuset-profile.yaml)

All test cases explicitly specify filenames and are unaffected by this change.

Assisted-by Claude:claude-sonnet-4-5
---
 tuna-cmd.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tuna-cmd.py +4 -4
index 3d4414d93d0e..5436f68c5029 100755
@@ -324,13 +324,13 @@ def gen_parser():
 
     # cpuset save
     cpuset_save = cpuset_subparser.add_parser('save', description='Save cpuset configuration to YAML profile', help='Save cpuset configuration')
-    cpuset_save.add_argument('filename', nargs='?', default='tuna-profile.yaml',
-                             help='Output YAML file (default: tuna-profile.yaml)')
+    cpuset_save.add_argument('filename', nargs='?', default='cpuset-profile.yaml',
+                             help='Output YAML file (default: cpuset-profile.yaml)')
 
     # cpuset apply
     cpuset_apply = cpuset_subparser.add_parser('apply', description='Apply cpuset configuration from YAML profile', help='Apply cpuset configuration')
-    cpuset_apply.add_argument('filename', nargs='?', default='tuna-profile.yaml',
-                              help='Input YAML file (default: tuna-profile.yaml)')
+    cpuset_apply.add_argument('filename', nargs='?', default='cpuset-profile.yaml',
+                              help='Input YAML file (default: cpuset-profile.yaml)')
     cpuset_apply.add_argument('-v', '--verbose', action='store_true',
                               help='Print detailed progress messages')
 
Signature · 1 line
2.55.0