diff options
author | Clark Williams <williams@redhat.com> | 2018-01-22 14:44:01 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2018-05-18 14:13:28 -0500 |
commit | 88bf5b37cdafef48de76415898c3d073abe5c746 (patch) | |
tree | bc93577034a62854bbad4a38de897ed096e057d8 | |
parent | 59791a9ad62765ef9696946a0ef615c27dad88cd (diff) | |
download | rt-tests-for_jkacur.tar.gz |
shuffle numa options around a bitfor_jkacur
Signed-off-by: Clark Williams <williams@redhat.com>
(cherry picked from commit 59aa86a9af7204f10def6872e1088d83fc7579bc)
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | src/cyclictest/cyclictest.c | 11 | ||||
-rw-r--r-- | src/cyclictest/rt_numa.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index b667c21..a975ef5 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1696,7 +1696,9 @@ static void trigger_update(struct thread_param *par, int diff, int64_t ts) void get_cpu_affinity(struct bitmask *cpus) { struct bitmask *bitmask = numa_allocate_cpumask(); -#if 0 +#if NUMA + numa_sched_getaffinity(0, bitmask); +#else int i, max_cpus = numa_num_configured_cpus(); cpu_set_t mask; int ret = sched_getaffinity(0, sizeof(mask), &mask); @@ -1712,10 +1714,9 @@ void get_cpu_affinity(struct bitmask *cpus) numa_bitmask_setbit(bitmask, i); } } -#else - numa_sched_getaffinity(0, bitmask); #endif - cpus = bitmask; + /* copy the contents to our argument */ + *cpus = *bitmask; } int main(int argc, char **argv) @@ -1726,7 +1727,7 @@ int main(int argc, char **argv) int max_cpus = sysconf(_SC_NPROCESSORS_ONLN); int i, ret = -1; int status; - int numa = numa_available(); + int numa = numa_available() == 0 ? 1 : 0; get_cpu_affinity(&allowed_cpus); diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h index 915cb5f..9614a62 100644 --- a/src/cyclictest/rt_numa.h +++ b/src/cyclictest/rt_numa.h @@ -23,8 +23,6 @@ #include "rt-utils.h" #include "error.h" -static int numa = 0; - #ifdef NUMA #include <numa.h> |