Re: for_each_online_cpu broken ?

David S. Miller
2005-12-08T05:38:32Z

From: Dave Jones <davej@redhat.com>
Date: Thu, 8 Dec 2005 00:33:02 -0500

> On Thu, Dec 08, 2005 at 06:26:32AM +0100, Andi Kleen wrote:
>
> > The possible map is fixed kind of BTW in 2.6.15rc*. It was a side effect
> > of CPU hotplug, which now uses a better algorithm to guess the
> > number of possible CPUs. In 2.6.15 you will just get half the number
> > of available CPUs in addition by default
>
> Yep, I noticed it offers a maximum of 6 cpus on my way.
> As a sidenote, seems kinda funny (and wasteful maybe?), doing this
> on a lot of hardware that isn't hotplug capable. (Whilst I could
> disable cpu hotplug in my local build, this isn't an answer for
> a generic distro kernel).

This can be dangerous btw, as some subsystem such as netfilter
allocate enormous datastructures based upon the largest possible
cpu number in the system.

In 2.6.16 it will use something a bit more intelligent, but
overestimating the possible cpu set can be quite a waste.