Re: [PATCH 09/10] percpu: implement new dynamic percpu allocator

From: Ingo Molnar
Date: Thu Feb 19 2009 - 06:02:23 EST



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> > + * To use this allocator, arch code should do the followings.
> > + *
> > + * - define CONFIG_HAVE_DYNAMIC_PER_CPU_AREA
> > + *
> > + * - define __addr_to_pcpu_ptr() and __pcpu_ptr_to_addr() to translate
> > + * regular address to percpu pointer and back
> > + *
> > + * - use pcpu_setup_static() during percpu area initialization to
> > + * setup kernel static percpu area
> > + */
>
> afacit nobody has answered your "is num_possible_cpus() ever a
> lot larger than num_online_cpus()" question.
>
> It is fairly important.

yeah.

On x86 we limit num_possible_cpus() at boot time from NR_CPUS to
the BIOS-enumerated set of possible CPUs - i.e. the two will
always be either equal, or be very close to each other.

( there used to be broken early BIOSes that enumerated more CPUs
than needed but it's very rare and because it also wastes BIOS
RAM/ROM it's something they'll usually avoid even if they dont
care about Linux. )

So this should be a pretty OK assumption.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/