[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Avoid mask based num_possible_cpus and num_online_cpus
On Fri, Jan 20, 2012 at 3:45 PM, KOSAKI Motohiro
<> wrote:
>>>> +int nr_online_cpus __read_mostly;
>>>> +EXPORT_SYMBOL(nr_online_cpus);
>>>> +
>>>>  void set_cpu_possible(unsigned int cpu, bool possible)
>>>>  {
>>>>       if (possible)
>>> Did you forget to add:
>>>        nr_possible_cpus = cpumask_weight(cpu_possible_mask);
>>> inside set_cpu_possible() ?
>> No. That was intentional as I have that coupled with nr_cpu_ids and
>> set once after all the bits are set in setup_nr_cpu_ids() instead of
>> doing for each bit set.
> But, Srivatsa's way seems more safer, no? Is there any advantage to make couple
> with nr_cpu_ids?

I think it is a tradeoff between safer and cleaner :). infact, that's
how I had coded the patch first. But, then I changed it to be in sync
with nr_cpu_ids as it seemed a bit cleaner (and also to make sure 2048
CPU guys won't come after me for doing the mask calculation 2048 times
during the boot).
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2012-01-21 00:59    [W:0.088 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site