[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100203072123.GA5428@liondog.tnic>
Date: Wed, 3 Feb 2010 08:21:23 +0100
From: Borislav Petkov <petkovbb@...glemail.com>
To: zhiyi <zhuang@...otago.ac.nz>
Cc: linux-kernel@...r.kernel.org, jkmair@...otago.ac.nz
Subject: Re: nr_cpu_ids incorrect on AMD Quad-Core Opteron 8380
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists