From: Borislav Petkov <petkovbb@googlemail.com>
To: zhiyi <zhuang@cs.otago.ac.nz>
Cc: linux-kernel@vger.kernel.org, jkmair@cs.otago.ac.nz
Subject: Re: nr_cpu_ids incorrect on AMD Quad-Core Opteron 8380
Date: Wed, 3 Feb 2010 08:21:23 +0100 [thread overview]
Message-ID: <20100203072123.GA5428@liondog.tnic> (raw)
In-Reply-To: <D65A73B5-D44A-4AEF-8B0E-35DC119127C9@cs.otago.ac.nz>
On Wed, Feb 03, 2010 at 10:33:46AM +1300, zhiyi wrote:
> The good thing is that I realized I should use num_present_cpus()
> instead of nr_cpu_ids for my purpose (get the number of real cores
> on the machine)
Just a minor thing: there could be a subtlety with hotplug when
using num_present_cpus() since this includes all CPUs, even the
hotplug-offlined ones. Depending on your case, you might want to use
num_online_cpus() instead. Look at the comment at the beginning of
<include/linux/cpumask.h> which explains all the different masks to
figure out which one fits your needs best.
--
Regards/Gruss,
Boris.
next prev parent reply other threads:[~2010-02-03 7:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 23:16 nr_cpu_ids incorrect on AMD Quad-Core Opteron 8380 zhiyi
2010-01-30 17:18 ` Borislav Petkov
2010-01-31 22:59 ` zhiyi
2010-02-01 13:57 ` Borislav Petkov
2010-02-01 15:04 ` Borislav Petkov
2010-02-02 0:49 ` zhiyi
2010-02-02 7:07 ` Borislav Petkov
2010-02-02 21:33 ` zhiyi
2010-02-03 7:21 ` Borislav Petkov [this message]
2010-02-02 0:35 ` zhiyi
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=20100203072123.GA5428@liondog.tnic \
--to=petkovbb@googlemail.com \
--cc=jkmair@cs.otago.ac.nz \
--cc=linux-kernel@vger.kernel.org \
--cc=zhuang@cs.otago.ac.nz \
/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