[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100215060655.GH5723@laptop>
Date: Mon, 15 Feb 2010 17:06:55 +1100
From: Nick Piggin <npiggin@...e.de>
To: David Rientjes <rientjes@...gle.com>
Cc: Andi Kleen <andi@...stfloor.org>, penberg@...helsinki.fi,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
haicheng.li@...el.com
Subject: Re: [PATCH] [3/4] SLAB: Set up the l3 lists for the memory of
freshly added memory v2
On Thu, Feb 11, 2010 at 01:45:16PM -0800, David Rientjes wrote:
> On Thu, 11 Feb 2010, Andi Kleen wrote:
>
> > Index: linux-2.6.32-memhotadd/mm/slab.c
> > ===================================================================
> > --- linux-2.6.32-memhotadd.orig/mm/slab.c
> > +++ linux-2.6.32-memhotadd/mm/slab.c
> > @@ -115,6 +115,7 @@
> > #include <linux/reciprocal_div.h>
> > #include <linux/debugobjects.h>
> > #include <linux/kmemcheck.h>
> > +#include <linux/memory.h>
> >
> > #include <asm/cacheflush.h>
> > #include <asm/tlbflush.h>
> > @@ -1554,6 +1555,23 @@ void __init kmem_cache_init(void)
> > g_cpucache_up = EARLY;
> > }
> >
> > +static int slab_memory_callback(struct notifier_block *self,
> > + unsigned long action, void *arg)
> > +{
> > + struct memory_notify *mn = (struct memory_notify *)arg;
> > +
> > + /*
> > + * When a node goes online allocate l3s early. This way
> > + * kmalloc_node() works for it.
> > + */
> > + if (action == MEM_ONLINE && mn->status_change_nid >= 0) {
> > + mutex_lock(&cache_chain_mutex);
> > + slab_node_prepare(mn->status_change_nid);
> > + mutex_unlock(&cache_chain_mutex);
> > + }
> > + return NOTIFY_OK;
> > +}
> > +
> > void __init kmem_cache_init_late(void)
> > {
> > struct kmem_cache *cachep;
> > @@ -1577,6 +1595,8 @@ void __init kmem_cache_init_late(void)
> > */
> > register_cpu_notifier(&cpucache_notifier);
> >
> > + hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI);
> > +
>
> Only needed for CONFIG_NUMA, but there's no side-effects for UMA kernels
> since status_change_nid will always be -1.
Compiler doesn't know that, though.
>
> Acked-by: David Rientjes <rientjes@...gle.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists