rt-tests/SOURCES/Remove-numa-option.patch
2021-09-10 04:02:41 +00:00

94 lines
3.1 KiB
Diff

From be3ef7f9d228c3753ba805a9d25ee4dd26171d67 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 19 Jun 2018 01:38:48 +0200
Subject: [PATCH] Remove --numa option
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 30 ++++++++++++++----------------
src/cyclictest/rt_numa.h | 6 ------
2 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 1dce8fc2bb64..484ea7fa3130 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1207,7 +1207,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
{"spike-nodes", required_argument, NULL, OPT_TRIGGER_NODES },
{"threads", optional_argument, NULL, OPT_THREADS },
{"unbuffered", no_argument, NULL, OPT_UNBUFFERED },
- {"numa", no_argument, NULL, OPT_NUMA },
{"verbose", no_argument, NULL, OPT_VERBOSE },
{"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC },
{"policy", required_argument, NULL, OPT_POLICY },
@@ -1215,7 +1214,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
{"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS },
{NULL, 0, NULL, 0 },
};
- int c = getopt_long(argc, argv, "a::A::b:c:d:D:h:H:i:l:MNo:p:mqrRsSt::uUvD:x",
+ int c = getopt_long(argc, argv, "a::A::b:c:d:D:h:H:i:l:MNo:p:mqrRsSt::uvD:x",
long_options, &option_index);
if (c == -1)
break;
@@ -1350,20 +1349,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
case 'u':
case OPT_UNBUFFERED:
setvbuf(stdout, NULL, _IONBF, 0); break;
- case 'U':
- case OPT_NUMA: /* NUMA testing */
- numa = 1; /* Turn numa on */
- if (smp)
- fatal("numa and smp options are mutually exclusive\n");
- numa_on_and_available();
-#ifdef NUMA
- num_threads = max_cpus;
- setaffinity = AFFINITY_USEALL;
-#else
- warn("cyclictest was not built with the numa option\n");
- warn("ignoring --numa or -U\n");
-#endif
- break;
case 'v':
case OPT_VERBOSE: verbose = 1; break;
case 'x':
@@ -1399,6 +1384,19 @@ static void process_options (int argc, char *argv[], int max_cpus)
}
}
+ if (!smp) { /* if smp wasn't requested, test for numa automatically */
+#ifdef NUMA
+ if (numa_available() != -1) {
+ numa = 1;
+ num_threads = max_cpus;
+ setaffinity = AFFINITY_USEALL;
+#else
+ warn("cyclictest was not built with the numa option\n");
+ numa = 0;
+#endif
+ }
+ }
+
if (option_affinity) {
if (smp) {
warn("-a ignored due to --smp\n");
diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h
index ec2994314e80..3970e681fe7b 100644
--- a/src/cyclictest/rt_numa.h
+++ b/src/cyclictest/rt_numa.h
@@ -192,12 +192,6 @@ static inline void rt_bitmask_free(struct bitmask *mask)
#endif /* LIBNUMA_API_VERSION */
-static void numa_on_and_available()
-{
- if (numa && (numa_available() == -1))
- fatal("--numa specified and numa functions not available.\n");
-}
-
#else /* ! NUMA */
struct bitmask {
--
2.14.4