shuffle numa options around a bit
Signed-off-by: Clark Williams <williams@redhat.com> (cherry picked from commit 59aa86a9af7204f10def6872e1088d83fc7579bc) Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
parent
47f82f1b44
commit
1e4b4dc250
|
@ -1713,7 +1713,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);
|
||||
|
@ -1729,10 +1731,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)
|
||||
|
@ -1743,7 +1744,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);
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
#include "rt-utils.h"
|
||||
#include "error.h"
|
||||
|
||||
static int numa = 0;
|
||||
|
||||
#ifdef NUMA
|
||||
#include <numa.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue