linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [Patch 002/002] Create/delete kmem_cache_node for SLUB on memory online callback
Date: Fri, 12 Oct 2007 10:19:30 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0710121014430.8605@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20071012133336.B9A5.Y-GOTO@jp.fujitsu.com>

On Fri, 12 Oct 2007, Yasunori Goto wrote:

> > > +	down_read(&slub_lock);
> > > +	list_for_each_entry(s, &slab_caches, list) {
> > > +		local_node = page_to_nid(virt_to_page(s));
> > > +		if (local_node == offline_node)
> > > +			/* This slub is on the offline node. */
> > > +			return -EBUSY;
> > > +	}
> > > +	up_read(&slub_lock);
> > 
> > So this checks if the any kmem_cache structure is on the offlined node? If
> > so then we cannot offline the node?
> 
> Right. If slabs' migration is possible, here would be good place for
> doing it. But, it is not possible (at least now).

I think you can avoid this check. The kmem_cache structures are allocated 
from the kmalloc array. The check if the kmalloc slabs are empty will fail 
if kmem_cache structures still exist on the node.

> > > +			 * because the node is used by slub yet.
> > > +			 */
> > 
> > It may be clearer to say:
> > 
> > "If nr_slabs > 0 then slabs still exist on the node that is going down.
> > We were unable to free them so we must fail."
> 
> Again. If nr_slabs > 0, offline_pages must be fail due to slabs
> remaining on the node before. So, this callback isn't called.

Ok then we can remove these checks?

> > > +static int slab_mem_going_online_callback(void *arg)
> > > +{
> > > +	struct kmem_cache_node *n;
> > > +	struct kmem_cache *s;
> > > +	struct memory_notify *marg = arg;
> > > +	int nid = marg->status_change_nid;
> > > +
> > > +	/* If the node already has memory, then nothing is necessary. */
> > > +	if (nid < 0)
> > > +		return 0;
> > 
> > The node must have memory????  Or we have already brought up the code?
> 
> kmem_cache_node is created at boot time if the node has memory.
> (Or, it is created by this callback on first added memory on the node).
> 
> When nid = - 1, kmem_cache_node is created before this node due to
> node has memory. 

So the function can be called for a node that is already online?

> > > +	 * New memory will be onlined on the node which has no memory so far.
> > > +	 * New kmem_cache_node is necssary for it.
> > 
> > "We are bringing a node online. No memory is available yet. We must 
> > allocate a kmem_cache_node structure in order to bring the node online." ?
> 
> Your mention might be ok.
> But. I would like to prefer to define status of node hotplug for
> exactitude like followings
> 
> 
> A)Node online -- pgdat is created and can be accessed for this node.
>                  but there are no gurantee that cpu or memory is onlined.
>                  This status is very close from memory-less node.
>                  But this might be halfway status for node hotplug.
>                  Node online bit is set. But N_HIGH_MEMORY
>                  (or N_NORMAL_MEMORY) might be not set.

Ahh.. Okay.

> B)Node has memory--
>                  one or more sections memory is onlined on the node.
>                  N_HIGH_MEMORY (or N_NORMAL_MEMORY) is set.
> 
> If first memory is onlined on the node, the node status changes
> from A) to B).
> 
> I feel this is very useful to manage "halfway status" of node
> hotplug. (So, memory-less node patch is very helpful for me.)
> 
> So, I would like to avoid using the word "node online" at here.
> But, if above definition is messy for others, I'll change it.

Ok can we talk about this as

	node online

and

	node memory available?

--
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-12 17:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12  2:18 [Patch 000/002] Rearrange notifier of memory hotplug Yasunori Goto
2007-10-12  2:20 ` [Patch 001/002] Make description of memory hotplug notifier in document Yasunori Goto
2007-10-12  4:18   ` Christoph Lameter
2007-10-12  4:33     ` Yasunori Goto
2007-10-12  2:22 ` [Patch 002/002] rearrange patch for notifier of memory hotplug Yasunori Goto
2007-10-12  2:24 ` [Patch 000/002] Make kmem_cache_node for SLUB on memory online to avoid panic(take 2) Yasunori Goto
2007-10-12  2:27   ` [Patch 001/002] extract kmem_cache_shrink Yasunori Goto
2007-10-12  4:09     ` Christoph Lameter
2007-10-12  4:41       ` Yasunori Goto
2007-10-12  2:29   ` [Patch 002/002] Create/delete kmem_cache_node for SLUB on memory online callback Yasunori Goto
2007-10-12  4:09     ` Christoph Lameter
2007-10-12  6:15       ` Yasunori Goto
2007-10-12 17:19         ` Christoph Lameter [this message]
2007-10-13  5:00           ` 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.0710121014430.8605@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).