Re: [PATCH] kmalloc_percpu

Andrew Morton (akpm@digeo.com)
Tue, 6 May 2003 01:47:45 -0700


Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> It's a tradeoff, but I think it's worth it for a kmalloc_percpu which
> is fast, space-efficient and numa-aware, since the code is needed
> anyway.

I don't beleive that kmalloc_percpu() itself needs to be fast, as you say.

The code is _not_ NUMA-aware. Is it?

> How about a compromise like the following (scaled with mem)?
> Untested, but you get the idea...

> + /* Plenty of memory? 1GB = 64k per-cpu. */
> + pool_size = max(((long long)num_physpages << PAGE_SHIFT) / 16384,
> + (long long)pool_size);

On 64GB 32-way that's 128MB of lowmem. Unpopular. I'd settle for a __setup
thingy here, and a printk when the memory runs out.

btw, what's wrong with leaving kmalloc_percpu() as-is, and only using this
allocator for DEFINE_PERCPU()?

-
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/