diff options
author | Joakim Hernberg <jbh@alchemy.lu> | 2014-08-14 19:29:29 +0200 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2014-08-15 14:52:28 +0200 |
commit | 863f1482220034de0a85f8150384931318325953 (patch) | |
tree | 5e132e464fbc7dac1603f2ed862343b4f4bd3c01 | |
parent | dd01e7dab9a4eb7adf752d6fc7706b7ebe2b2f2c (diff) | |
download | rt-tests-863f1482220034de0a85f8150384931318325953.tar.gz |
cyclictest: make affinity option only use number of online cpus
When I boot my 8 core i7 laptop with the maxcpus=4 kernel boot flag,
cyclictest -S runs 8 threads. This patch makes it only use the number
of online cpus instead.
Signed-off-by: Joakim Hernberg <jhernberg@alchemy.lu>
Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r-- | src/cyclictest/cyclictest.c | 2 | ||||
-rw-r--r-- | src/cyclictest/rt_numa.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index a3e7b1d..c727d54 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1763,7 +1763,7 @@ int main(int argc, char **argv) sigset_t sigset; int signum = SIGALRM; int mode; - int max_cpus = sysconf(_SC_NPROCESSORS_CONF); + int max_cpus = sysconf(_SC_NPROCESSORS_ONLN); int i, ret = -1; int status; diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h index 60a1437..06c9420 100644 --- a/src/cyclictest/rt_numa.h +++ b/src/cyclictest/rt_numa.h @@ -128,7 +128,7 @@ static int rt_numa_numa_node_of_cpu(int cpu) int max_node, max_cpus; max_node = numa_max_node(); - max_cpus = sysconf(_SC_NPROCESSORS_CONF); + max_cpus = sysconf(_SC_NPROCESSORS_ONLN); if (cpu > max_cpus) { errno = EINVAL; |