diff mbox series

[3/3] Revert "signaltest: Always use libnuma"

Message ID 20210219184801.13905-4-jkacur@redhat.com
State New
Headers show
Series [1/3] Revert "cyclictest: Use affinity_mask for steering thread placement" | expand

Commit Message

John Kacur Feb. 19, 2021, 6:48 p.m. UTC
This reverts commit 3079f1b10d086b878f52607035b328f450b8033e.

libnuma is a build-time requirement but not a runtime requirement

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/signaltest/signaltest.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 1d1b070cf12b..4f8e7caea2c1 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -207,6 +207,7 @@  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;
 static char outfile[MAX_PATH];
 
@@ -222,7 +223,6 @@  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;
@@ -253,6 +253,8 @@  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);
@@ -337,6 +339,9 @@  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;
 	}
@@ -412,9 +417,6 @@  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())