Re: [PATCH] slob: poor man's NUMA, take 2.

Matt Mackall
2007-06-13T13:15:49Z

On Wed, Jun 13, 2007 at 06:21:09PM +0900, Paul Mundt wrote:
> Here's an updated copy with the node variants always defined.
>
> I've left the nid=-1 case in as the default for the non-node variants, as
> this is the approach also used by SLUB. alloc_pages() is special cased
> for NUMA, and takes the memory policy under advisement when doing the
> allocation, so the page ends up in a reasonable place.
>

> +void *__kmalloc(size_t size, gfp_t gfp)
> +{
> + return __kmalloc_node(size, gfp, -1);
> +}
> EXPORT_SYMBOL(__kmalloc);

> +void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags)
> +{
> + return kmem_cache_alloc_node(c, flags, -1);
> +}
> EXPORT_SYMBOL(kmem_cache_alloc);

Now promote these guys to inlines in slab.h. At which point all the
new NUMA code become a no-op on !NUMA.

--
Mathematics is the supreme nostalgia of our time.