rt-tests/SOURCES/cyclictest-Make-sure-affini...

57 lines
1.6 KiB
Diff

From 966b4eeda61b4c623a5ef423236dc710b31c1532 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 20 Feb 2019 23:16:34 +0100
Subject: [PATCH] cyclictest: Make sure affinity is respected when numa is
detected
Make sure affinity is respected when numa is automatically detected and
when smp is not specified. Don't break the way smp currently works.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 1bd63fd93dce..ed59edefbf97 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1218,7 +1218,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
case 'a':
case OPT_AFFINITY:
option_affinity = 1;
- if (smp || numa)
+ if (smp)
break;
if (optarg != NULL) {
parse_cpumask(optarg, max_cpus);
@@ -1384,8 +1384,10 @@ static void process_options (int argc, char *argv[], int max_cpus)
#ifdef NUMA
if (numa_available() != -1) {
numa = 1;
- num_threads = max_cpus;
- setaffinity = AFFINITY_USEALL;
+ if (setaffinity == AFFINITY_UNSPECIFIED) {
+ num_threads = max_cpus;
+ setaffinity = AFFINITY_USEALL;
+ }
}
#else
warn("cyclictest was not built with the numa option\n");
@@ -1394,11 +1396,8 @@ static void process_options (int argc, char *argv[], int max_cpus)
}
if (option_affinity) {
- if (smp) {
+ if (smp)
warn("-a ignored due to smp mode\n");
- } else if (numa) {
- warn("-a ignored due to numa mode\n");
- }
}
if (smi) {
--
2.20.1