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:
parent
5078ecff39
commit
b23d5ced10
|
@ -1763,7 +1763,7 @@ int main(int argc, char **argv)
|
||||||
sigset_t sigset;
|
sigset_t sigset;
|
||||||
int signum = SIGALRM;
|
int signum = SIGALRM;
|
||||||
int mode;
|
int mode;
|
||||||
int max_cpus = sysconf(_SC_NPROCESSORS_CONF);
|
int max_cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
int i, ret = -1;
|
int i, ret = -1;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ static int rt_numa_numa_node_of_cpu(int cpu)
|
||||||
int max_node, max_cpus;
|
int max_node, max_cpus;
|
||||||
|
|
||||||
max_node = numa_max_node();
|
max_node = numa_max_node();
|
||||||
max_cpus = sysconf(_SC_NPROCESSORS_CONF);
|
max_cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
|
||||||
if (cpu > max_cpus) {
|
if (cpu > max_cpus) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue