diff mbox series

[4/6] rteval: Exclude isolcpus from stressng by default

Message ID 20230630091951.916865-5-tglozar@redhat.com
State New
Headers show
Series rteval: Handle isolcpus correctly | expand

Commit Message

Tomas Glozar June 30, 2023, 9:19 a.m. UTC
Note: this has little effect now, because the cpus variables is only
used for removing empty nodes unless a cpulist is specified by the user.
However, this can change in the future.

Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 rteval/modules/loads/stressng.py | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py
index 85cb473..800fdec 100644
--- a/rteval/modules/loads/stressng.py
+++ b/rteval/modules/loads/stressng.py
@@ -9,6 +9,7 @@  from rteval.Log import Log
 from rteval.systopology import CpuList, SysTopology
 
 expand_cpulist = CpuList.expand_cpulist
+nonisolated_cpulist = CpuList.nonisolated_cpulist
 
 class Stressng(CommandLineLoad):
     " This class creates a load module that runs stress-ng "
@@ -69,6 +70,10 @@  class Stressng(CommandLineLoad):
             # if a cpulist was specified, only allow cpus in that list on the node
             if self.cpulist:
                 cpus[n] = [c for c in cpus[n] if c in expand_cpulist(self.cpulist)]
+            # if a cpulist was not specified, exclude isolated cpus
+            else:
+                cpus[n] = CpuList.nonisolated_cpulist(cpus[n])
+
 
         # remove nodes with no cpus available for running
         for node, cpu in cpus.items():