diff --git a/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch b/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch new file mode 100644 index 0000000..e55a6f1 --- /dev/null +++ b/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch @@ -0,0 +1,35 @@ +From be811d28a471cfcaf7960289e00960e7f5b18f03 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 15 Jul 2021 10:09:03 -0400 +Subject: [PATCH] rteval: Restrict measurement threads to the cpus in cpumask + +Only run measurement threads on cpus in the list from sched_getaffinity + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index 232bd6b9acc6..ae91dbb7c043 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -209,6 +209,15 @@ class Cyclictest(rtevalModulePrototype): + else: + self.__cpus = online_cpus() + ++ # Get the cpuset from the environment ++ cpuset = os.sched_getaffinity(0) ++ ++ # Convert the elements to strings ++ cpuset = [str(c) for c in cpuset] ++ ++ # Only include cpus that are in the cpuset ++ self.__cpus = [c for c in self.__cpus if c in cpuset] ++ + self.__numcores = len(self.__cpus) + + info = cpuinfo() +-- +2.31.1 + diff --git a/SPECS/rteval.spec b/SPECS/rteval.spec index af11e30..e253ec9 100644 --- a/SPECS/rteval.spec +++ b/SPECS/rteval.spec @@ -1,6 +1,6 @@ Name: rteval Version: 3.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Utility to evaluate system suitability for RT Linux Group: Development/Tools @@ -33,6 +33,7 @@ Obsoletes: rteval-common <= 3.1 #Patches Patch1: rteval-Fix-incorrect-import-in-sysinfo-dir.patch Patch2: rteval-Remove-python-schedutils-requirement.patch +Patch3: rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch %description The rteval script is a utility for measuring various aspects of @@ -47,6 +48,7 @@ to the screen. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %{__python3} setup.py build @@ -84,6 +86,10 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/rteval/__pycache__/* %changelog +* Fri Aug 20 2021 John Kacur - 3.1-5 +- Restrict measurement threads to cpus in cpumask +Resolves: rhbz#1992732 + * Wed Jan 13 2021 John Kacur - 3.1-4 - Remove python-schedutils requirement - Fix spec file to make Obsoletes rteval-common cover all necessary releases