lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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.


\
 
 \ /
  Last update: 2010-02-03 08:29    [W:0.072 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site