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>
This commit is contained in:
Joakim Hernberg 2014-08-14 19:29:29 +02:00 committed by John Kacur
parent 5078ecff39
commit b23d5ced10
2 changed files with 2 additions and 2 deletions

View File

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

View File

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