From: Dave Jones <davej@redhat.com>
To: Dan Maas <dmaas@maasdigital.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Distinguish real vs. virtual CPUs?
Date: Mon, 21 Mar 2005 20:56:03 -0500 [thread overview]
Message-ID: <20050322015603.GB19541@redhat.com> (raw)
In-Reply-To: <20050321202726.A7630@morpheus>
On Mon, Mar 21, 2005 at 08:27:26PM -0500, Dan Maas wrote:
> Is there a canonical way for user-space software to determine how many
> real CPUs are present in a system (as opposed to HyperThreaded or
> otherwise virtual CPUs)?
>
> We have an application that for performance reasons wants to run one
> process per CPU. However, on a HyperThreaded system /proc/cpuinfo
> lists two CPUs, and running two processes in this case is the wrong
> thing to do. (Hyperthreading ends up degrading our performance,
> perhaps due to cache or bus contention).
Compare the 'physical id' fields of /proc/cpuinfo, and count
how many unique values you get.
Ie, on my dual+ht, I see..
physical id : 0
physical id : 0
physical id : 3
physical id : 3
Which indicates 2 real CPUs split in two.
Dave
next prev parent reply other threads:[~2005-03-22 2:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-22 1:27 Distinguish real vs. virtual CPUs? Dan Maas
2005-03-22 1:56 ` Dave Jones [this message]
2005-03-22 11:55 ` Dr. David Alan Gilbert
2005-03-22 15:02 ` not for amd " Tom Vier
2005-03-22 2:01 ` Daniel Andersen
2005-03-22 2:12 ` J.A. Magallon
-- strict thread matches above, loose matches on Subject: below --
2005-03-22 4:29 Pallipadi, Venkatesh
2005-03-22 21:26 ` Bill Davidsen
2005-03-22 21:38 ` Jan Engelhardt
2005-03-23 17:52 ` Tom Vier
2005-03-23 21:32 ` Bill Davidsen
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=20050322015603.GB19541@redhat.com \
--to=davej@redhat.com \
--cc=dmaas@maasdigital.com \
--cc=linux-kernel@vger.kernel.org \
/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