linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] make SMP option only use online cpus (cyclictest)
@ 2014-08-14 17:29 Joakim Hernberg
  2014-08-15 12:54 ` John Kacur
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Hernberg @ 2014-08-14 17:29 UTC (permalink / raw)
  To: linux-rt-users; +Cc: Clark Williams, John Kacur

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 online
cpus instead.

diff --git a/src/cyclictest/cyclictest.c
b/src/cyclictest/cyclictest.c index 4547831..92fc346 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1740,7 +1740,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 e64c446..c2b3e85 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;

--

   Joakim

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-15 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 17:29 [RFC PATCH] make SMP option only use online cpus (cyclictest) Joakim Hernberg
2014-08-15 12:54 ` John Kacur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).