Messages in this thread | | | Date | Fri, 20 Jan 2012 17:01:24 -0800 | Subject | Re: [PATCH] Avoid mask based num_possible_cpus and num_online_cpus | From | Venki Pallipadi <> |
| |
On Thu, Jan 19, 2012 at 12:40 PM, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote: > On 1/19/2012 3:01 PM, Venkatesh Pallipadi wrote: >> Does this look better? Will send separate patch to fix code >> using num_possible_cpus() when they actually need nr_cpu_ids. > > Sound ok to me. but I have two requests. > > - Please mesure how much time (or cycle) spented by cpumask_weight(cpu_possible_mask).
On two of the recentish x86 server CPUs, __sw_hweight64() base mask_weight() takes ~300 cycles. popcnt instruction based weight takes <10 cycles.
> - After your patch, nr_possible_cpus() return different value from before.
Yes. I have tested this on x86 and haven't seen any problem.
> Please verify this change doesn't makes any side effect. > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |