From a17551938cff4d849e055c31316d4de278d7da6c Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 14 Aug 2019 00:12:35 +0200 Subject: [PATCH] rt-tests: cyclictest: Without -t default to 1 thread in numa case Don't ignore -t num when detecting if numa support is available. Also, don't be too smart about details in the case of numa support This means, if -t is not specified then the default is 1. affinity must also be explicily set. Signed-off-by: John Kacur --- src/cyclictest/cyclictest.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 83f169d..d101e3d 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1183,6 +1183,7 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'a': case OPT_AFFINITY: option_affinity = 1; + /* smp sets AFFINITY_USEALL in OPT_SMP */ if (smp) break; if (optarg != NULL) { @@ -1345,15 +1346,11 @@ static void process_options (int argc, char *argv[], int max_cpus) } } - if (!smp) { /* if smp wasn't requested, test for numa automatically */ + /* if smp wasn't requested, test for numa automatically */ + if (!smp) { #ifdef NUMA - if (numa_available() != -1) { + if (numa_available() != -1) numa = 1; - if (setaffinity == AFFINITY_UNSPECIFIED) { - num_threads = max_cpus; - setaffinity = AFFINITY_USEALL; - } - } #else warn("cyclictest was not built with the numa option\n"); numa = 0;