linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Hernberg <jbh@alchemy.lu>
To: linux-rt-users@vger.kernel.org
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [RFC PATCH] make SMP option only use online cpus (cyclictest)
Date: Thu, 14 Aug 2014 19:29:29 +0200	[thread overview]
Message-ID: <20140814192929.004ab9d7@alchemy.lu> (raw)

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

             reply	other threads:[~2014-08-14 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14 17:29 Joakim Hernberg [this message]
2014-08-15 12:54 ` [RFC PATCH] make SMP option only use online cpus (cyclictest) John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140814192929.004ab9d7@alchemy.lu \
    --to=jbh@alchemy.lu \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).