Blame SOURCES/rt-numa-ignore-runtime-cpumask-if-a-CPULIST-is-speci.patch

b69aad
From 795433f50f20ef7598db5cfe991b5386e4080d41 Mon Sep 17 00:00:00 2001
b69aad
From: Marcelo Tosatti <mtosatti@redhat.com>
b69aad
Date: Fri, 28 Jan 2022 15:39:59 -0300
b69aad
Subject: [PATCH 2/2] rt-numa: ignore runtime cpumask if -a CPULIST is
b69aad
 specified
b69aad
b69aad
When using isolcpus kernel command line option, the CPUs
b69aad
specified at isolcpus= are not part of the run time environment
b69aad
cpumask.
b69aad
b69aad
This causes "cyclictest -a isolatedcpus" to fail with:
b69aad
b69aad
WARN: Couldn't setaffinity in main thread: Invalid argument
b69aad
FATAL: No allowable cpus to run on
b69aad
 # /dev/cpu_dma_latency set to 0us
b69aad
b69aad
To fix this, ignore the runtime cpumask if neither "+", "!"
b69aad
are specified in the cpu list string.
b69aad
b69aad
Suggested by Sebastian Andrzej Siewior.
b69aad
b69aad
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
b69aad
b69aad
v2: fix changelog typo
b69aad
v3: simplified version (John Kacur)
b69aad
b69aad
Signed-off-by: John Kacur <jkacur@redhat.com>
b69aad
---
b69aad
 src/lib/rt-numa.c | 3 ++-
b69aad
 1 file changed, 2 insertions(+), 1 deletion(-)
b69aad
b69aad
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c
b69aad
index ee5ab99684d8..3eead80c3b2b 100644
b69aad
--- a/src/lib/rt-numa.c
b69aad
+++ b/src/lib/rt-numa.c
b69aad
@@ -131,7 +131,8 @@ int parse_cpumask(char *str, int max_cpus, struct bitmask **cpumask)
b69aad
 		return 0;
b69aad
 	}
b69aad
 
b69aad
-	use_current_cpuset(max_cpus, mask);
b69aad
+	if (strchr(str, '!') != NULL || strchr(str, '+') != NULL)
b69aad
+		use_current_cpuset(max_cpus, mask);
b69aad
 	*cpumask = mask;
b69aad
 
b69aad
 	return 0;
b69aad
-- 
b69aad
2.34.1
b69aad