summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Hernberg <jbh@alchemy.lu>2014-08-14 19:29:29 +0200
committerJohn Kacur <jkacur@redhat.com>2014-08-18 22:49:17 +0200
commitb23d5ced109e69369dbb372d1ce411e17b93487c (patch)
tree5e132e464fbc7dac1603f2ed862343b4f4bd3c01
parent5078ecff39e0284425acb8035c0addca7dcda68f (diff)
downloadrt-tests-b23d5ced109e69369dbb372d1ce411e17b93487c.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.c2
-rw-r--r--src/cyclictest/rt_numa.h2
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;