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

From: Christoph Lameter
Date: Thu Jul 21 2011 - 11:27:46 EST




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.