linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [Patch / 002](memory hotplug) Callback function to create kmem_cache_node.
Date: Tue, 02 Oct 2007 11:20:43 +0900	[thread overview]
Message-ID: <20071002105422.2790.Y-GOTO@jp.fujitsu.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0710011334090.19779@schroedinger.engr.sgi.com>

> On Mon, 1 Oct 2007, Yasunori Goto wrote:
> 
> > +#ifdef CONFIG_MEMORY_HOTPLUG
> > +static void __slab_callback_offline(int nid)
> > +{
> > +	struct kmem_cache_node *n;
> > +	struct kmem_cache *s;
> > +
> > +	list_for_each_entry(s, &slab_caches, list) {
> > +		if (s->node[nid]) {
> > +			n = get_node(s, nid);
> > +			s->node[nid] = NULL;
> > +			kmem_cache_free(kmalloc_caches, n);
> > +		}
> > +	}
> > +}
> 
> I think we need to bug here if there are still objects on the node that 
> are in use. This will silently discard the objects.
> 
Here is just the rollback code for an allocation failure of
kmem_cache_node in halfway.
So, there is a case some of them are not allocated yet.
Any slabs don't use new kmem_cache_node before the new nodes page is
available --so far--.
But, in the future, here will be useful for node hot-unplug code,
and its check will be necessary.  Ok. I'll add its check.

Do you mean that just nr_slabs should be checked like followings?
I'm not sure this is enough.

    :
if (s->node[nid]) {
	n = get_node(s, nid);
	if (!atomic_read(&n->nr_slabs)) {
		s->node[nid] = NULL;
		kmem_cache_free(kmalloc_caches, n);
	}
}
    :
    :

Thanks.

-- 
Yasunori Goto 


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

  reply	other threads:[~2007-10-02  2:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01  9:30 [Patch / 000](memory hotplug) Fix NULL pointer access of kmem_cache_node when hot-add Yasunori Goto
2007-10-01  9:33 ` [Patch / 001](memory hotplug) fix some defects of memory notifer callback interface Yasunori Goto
2007-10-01  9:34 ` [Patch / 002](memory hotplug) Callback function to create kmem_cache_node Yasunori Goto
2007-10-01 20:34   ` Christoph Lameter
2007-10-02  2:20     ` Yasunori Goto [this message]
2007-10-02 18:29       ` Christoph Lameter
2007-10-03 14:59         ` Yasunori Goto
2007-10-03 18:00           ` Christoph Lameter
2007-10-04  2:00             ` Yasunori Goto
2007-10-01  9:38 ` [Patch 000/002](memory hotplug) Fix NULL pointer access of kmem_cache_node when hot-add 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=20071002105422.2790.Y-GOTO@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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