From: Christoph Lameter <clameter@sgi.com>
To: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: [RFC/Patch](memory hotplug) fix null pointer access of kmem_cache_node after memory hotplug
Date: Tue, 18 Sep 2007 12:05:32 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0709181200400.3351@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070918211932.0FFD.Y-GOTO@jp.fujitsu.com>
On Tue, 18 Sep 2007, Yasunori Goto wrote:
> Its cause was null pointer access to kmem_cache_node of SLUB at
> discard_slab().
> In my understanding, it should be created for all slubs after
> memory-less-node(or new node) gets new memory. But, current -mm doen't it.
> This patch fix for it.
Right. Isnt there a notifier chain that can be used to create the missing
node structure?
> If kmem_cache_node is created at online_pages() of memory hot-add,
> it should be done before build_zonelist to avoid race condition.
> But, it means kmem_cache_node must be allocated on other old nodes
> due not to complete initialization.
Why before build_zonelist? The regular slab bootstrap occurs after
zonelist creation.
> I think this "delay creation" fix is better way than it.
Looks like this is a way to on demand node structure creation?
> I know that failure case of kmem_cache_alloc_node() must be written
> and the prototype of init_kmem_cache_node() here is not good.
> Just I would like to confirm that I don't overlook something about SLUB.
Could be okay. I would feel better if we always had a per node structure
for each available node on the node that it covers.
> + else if (node_state(page_nid, N_HIGH_MEMORY) && s != kmalloc_caches) {
> + /*
> + * If new memory is onlined on new(or memory less) node,
> + * this will happen. (Second comparison is to avoid eternal
> + * recursion.)
> + */
For memoryless nodes this function will return NULL which will cause
fallback. It looks like we are not going into this branch because in that
case N_HIGH_MEMORY will not be set for the node.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-09-18 19:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 12:33 Yasunori Goto
2007-09-18 19:05 ` Christoph Lameter [this message]
2007-09-19 2:12 ` Yasunori Goto
2007-09-19 17:23 ` Christoph Lameter
2007-09-20 2:06 ` Yasunori Goto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0709181200400.3351@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=y-goto@jp.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox