diff mbox series

[v3] rt-numa: ignore runtime cpumask if -a CPULIST is specified

Message ID YfQ4f1CWDubRMlmA@fuller.cnet
State New
Headers show
Series [v3] rt-numa: ignore runtime cpumask if -a CPULIST is specified | expand

Commit Message

Marcelo Tosatti Jan. 28, 2022, 6:39 p.m. UTC
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>

v3: simplified version (John Kacur)
v2: fix changelog typo

Comments

John Kacur Jan. 28, 2022, 9:11 p.m. UTC | #1
On Fri, 28 Jan 2022, Marcelo Tosatti wrote:

> 
> 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>
> 
> v3: simplified version (John Kacur)
> v2: fix changelog typo
> 
> 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;
> 
> 

Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

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;