summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2022-01-28 15:39:59 -0300
committerJohn Kacur <jkacur@redhat.com>2022-01-28 16:09:57 -0500
commit795433f50f20ef7598db5cfe991b5386e4080d41 (patch)
treef97c44e0200147d008fe29207edf0dad2874a209
parent4fac6f28af3aec1c88f19bf96ef73541c1ae5858 (diff)
downloadrt-tests-795433f50f20ef7598db5cfe991b5386e4080d41.tar.gz
rt-numa: ignore runtime cpumask if -a CPULIST is specified
When using isolcpus kernel command line option, the CPUs specified at isolcpus= are not part of the run time environment cpumask. This causes "cyclictest -a isolatedcpus" to fail with: WARN: Couldn't setaffinity in main thread: Invalid argument FATAL: No allowable cpus to run on # /dev/cpu_dma_latency set to 0us To fix this, ignore the runtime cpumask if neither "+", "!" are specified in the cpu list string. Suggested by Sebastian Andrzej Siewior. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> v2: fix changelog typo v3: simplified version (John Kacur) Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--src/lib/rt-numa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c
index ee5ab99..3eead80 100644
--- a/src/lib/rt-numa.c
+++ b/src/lib/rt-numa.c
@@ -131,7 +131,8 @@ int parse_cpumask(char *str, int max_cpus, struct bitmask **cpumask)
return 0;
}
- use_current_cpuset(max_cpus, mask);
+ if (strchr(str, '!') != NULL || strchr(str, '+') != NULL)
+ use_current_cpuset(max_cpus, mask);
*cpumask = mask;
return 0;