[PATCH 2/2] cyclictest: Make sure affinity is respected when numa is detected

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

 



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@xxxxxxxxxx>
---
 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




[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