Re: [PATCH] mm-slab: allocate kmem_cache with __GFP_REPEAT

Christoph Lameter
2011-07-21T15:27:42Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 825 bytes --]

On Thu, 21 Jul 2011, Eric Dumazet wrote:

> Le mercredi 20 juillet 2011 à 09:52 -0500, Christoph Lameter a écrit :
>
> > We should be making it a per cpu pointer like slub then. I looked at what
> > it would take to do so a couple of month ago but it was quite invasive.
> >
>
> I took a look at this too, but using percpu data would consume more
> memory, because percpu allocator allocates memory blobs for all possible
> cpus, while current code handles online/offline cpu nicely.

The number of possible cpus is determined on bootup. If the BIOS provides
the right information about which cpus are present and if there is no
hotswapping of cpus possible then only per cpu areas for the actual
functioning cpus are allocated. Certainly no desktop bios will indicate
that 4096 cpus are possible.