Re: [rt-tests v2 v2 07/20] signaltest: Always use libnuma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 18 Dec 2020, Daniel Wagner wrote:

> libnuma is hard dependency for signaltest. Thus we can always call
> numa_initialize(). This allows us to remove the global 'numa' variable
> to track if libnuma has been initialized or not.
> 
> Signed-off-by: Daniel Wagner <dwagner@xxxxxxx>
> ---
>  src/signaltest/signaltest.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
> index 918d2ab98f6e..b3a82f8c4f65 100644
> --- a/src/signaltest/signaltest.c
> +++ b/src/signaltest/signaltest.c
> @@ -206,7 +206,6 @@ static int quiet;
>  static int lockall;
>  static struct bitmask *affinity_mask = NULL;
>  static int smp = 0;
> -static int numa = 0;
>  static int setaffinity = AFFINITY_UNSPECIFIED;
>  
>  /* Process commandline options */
> @@ -214,6 +213,7 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
>  {
>  	int option_affinity = 0;
>  	int error = 0;
> +	int numa = 0;
>  
>  	for (;;) {
>  		int option_index = 0;
> @@ -242,8 +242,6 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
>  			/* smp sets AFFINITY_USEALL in OPT_SMP */
>  			if (smp)
>  				break;
> -			if (numa_initialize())
> -				fatal("Couldn't initialize libnuma");
>  			numa = 1;
>  			if (optarg) {
>  				parse_cpumask(optarg, max_cpus, &affinity_mask);
> @@ -298,9 +296,6 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
>  
>  	/* if smp wasn't requested, test for numa automatically */
>  	if (!smp) {
> -		if (numa_initialize())
> -			fatal("Couldn't initialize libnuma");
> -		numa = 1;
>  		if (setaffinity == AFFINITY_UNSPECIFIED)
>  			setaffinity = AFFINITY_USEALL;
>  	}
> @@ -354,6 +349,9 @@ int main(int argc, char **argv)
>  	int status, cpu;
>  	int max_cpus = sysconf(_SC_NPROCESSORS_ONLN);
>  
> +	if (numa_initialize())
> +		fatal("Couldn't initialize libnuma");
> +
>  	process_options(argc, argv, max_cpus);
>  
>  	if (check_privs())
> -- 
> 2.29.2
> 
> 
Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux