Skip to content

rteval: Add cgroup v2 cpuset integration for dynamic CPU isolation

John Kacur linux-rt-users 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7rteval: Add cpuset integration infrastructure (WIP)rteval-cmd rteval/__init__.py rteval/cpusetmanager.py +6 more+454 -130 replies
2/7rteval: Add --cleanup-cpusets flag to remove leftover cpusetsrteval-cmd rteval/cpusetmanager.py+12 -10 replies
3/7rteval: Reorganize command-line arguments into logical groupsrteval-cmd+59 -450 replies
4/7rteval: Simplify cpuset implementation to match isolcpus philosophyrteval-cmd rteval/__init__.py rteval/cpusetmanager.py +3 more+30 -1420 replies
5/7rteval: Add local/ directory to .gitignore for development files.gitignore+1 -00 replies
6/7rteval: Update cpuset documentation to reflect simplified implementationrteval-cmd rteval/cpusetmanager.py+3 -20 replies
7/7rteval: Warn when all CPUs isolated and loads have no CPUsrteval-cmd+9 -00 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchClaude Sonnet 4.5
1/7
2/7
3/7
4/7Co-Authored-By
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] rteval: Add cgroup v2 cpuset integration for dynamic CPU isolation

This patch series adds cpuset integration to rteval, providing dynamic CPU isolation using cgroup v2 cpusets as an alternative or complement to the traditional isolcpus boot parameter.

Key features:
- New --cpusets flag enables cpuset-based isolation for measurements
- --housekeeping flag now works without requiring isolcpus when used with --cpusets
- --cleanup-cpusets utility flag removes leftover cpusets from crashed runs
- Automatic cleanup using Python context managers
- Full backward compatibility (no cpusets created without --cpusets flag)

Implementation philosophy:
The simplified implementation mirrors rteval's existing isolcpus behavior:
- Measurement threads get cpuset isolation (quiet CPUs for latency testing)
- Housekeeping tasks optionally get cpuset isolation (keep system noise away)
- Load processes use taskset affinity (no cpuset needed, just like without isolcpus)

This approach avoids complexity of migrating short-lived load processes while providing the isolation needed for accurate latency measurements.

Benefits over isolcpus alone:
- No reboot required to change CPU isolation
- Dynamic reconfiguration for testing different scenarios
- Housekeeping can use any CPUs (not restricted to non-isolated CPUs)
- Can be combined with isolcpus for layered isolation

The patch series includes:
1. Core cpuset infrastructure and manager
2. Cleanup utility for leftover cpusets
3. Command-line argument reorganization for clarity
4. Simplified implementation (measurements + housekeeping only)
5. Development directory for untracked test files
6. Documentation updates
7. Warning for edge case (all CPUs isolated)

Tested on systems with and without isolcpus, with comprehensive test suite validating all scenarios including cleanup on interrupt (Ctrl+C).

John Kacur (7):
rteval: Add cpuset integration infrastructure (WIP)
rteval: Add --cleanup-cpusets flag to remove leftover cpusets
rteval: Reorganize command-line arguments into logical groups
rteval: Simplify cpuset implementation to match isolcpus philosophy
rteval: Add local/ directory to .gitignore for development files
rteval: Update cpuset documentation to reflect simplified
implementation
rteval: Warn when all CPUs isolated and loads have no CPUs

 .gitignore                               |   1 +
 rteval-cmd                               | 193 +++++++++++++------
 rteval/__init__.py                       |  12 +-
 rteval/cpusetmanager.py                  | 224 +++++++++++++++++++++++
 rteval/modules/__init__.py               |  30 +++
 rteval/modules/loads/hackbench.py        |   1 -
 rteval/modules/loads/kcompile.py         |   1 -
 rteval/modules/measurement/cyclictest.py |   5 +
 rteval/modules/measurement/timerlat.py   |   6 +
 9 files changed, 419 insertions(+), 54 deletions(-)
 create mode 100644 rteval/cpusetmanager.py
Signature · 1 line
2.54.0