linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, rjw@sisk.pl,
	kosaki.motohiro@jp.fujitsu.com, kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH] cpu/mem hotplug: Add try_online_node() for cpu_up()
Date: Tue, 10 Sep 2013 07:55:37 -0600	[thread overview]
Message-ID: <1378821337.10300.990.camel@misato.fc.hp.com> (raw)
In-Reply-To: <522E92A0.80502@jp.fujitsu.com>

On Tue, 2013-09-10 at 12:31 +0900, Yasuaki Ishimatsu wrote:
> (2013/09/10 9:24), Toshi Kani wrote:
 :
> > diff --git a/kernel/cpu.c b/kernel/cpu.c
> > index d7f07a2..c10b285 100644
> > --- a/kernel/cpu.c
> > +++ b/kernel/cpu.c
> > @@ -420,11 +420,6 @@ int cpu_up(unsigned int cpu)
> >   {
> >   	int err = 0;
> >   
> > -#ifdef	CONFIG_MEMORY_HOTPLUG
> > -	int nid;
> > -	pg_data_t	*pgdat;
> > -#endif
> > -
> >   	if (!cpu_possible(cpu)) {
> >   		printk(KERN_ERR "can't online cpu %d because it is not "
> >   			"configured as may-hotadd at boot time\n", cpu);
> > @@ -435,27 +430,9 @@ int cpu_up(unsigned int cpu)
> >   		return -EINVAL;
> >   	}
> >   
> > -#ifdef	CONFIG_MEMORY_HOTPLUG
> > -	nid = cpu_to_node(cpu);
> > -	if (!node_online(nid)) {
> > -		err = mem_online_node(nid);
> > -		if (err)
> > -			return err;
> > -	}
> > -
> > -	pgdat = NODE_DATA(nid);
> > -	if (!pgdat) {
> 
> > -		printk(KERN_ERR
> > -			"Can't online cpu %d due to NULL pgdat\n", cpu);
> 
> Please move this comments into try_online_node() too.

This code block is no longer necessary, but I will add a pr_err() when
hotadd_new_pgdat() returns NULL in try_oline_node() below.

> > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> > index ed85fe3..c326bdf 100644
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -1044,14 +1044,19 @@ static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
> >   }
> >   
> >   
> > -/*
> > +/**
> > + * try_online_node - online a node if offlined
> > + *
> >    * called by cpu_up() to online a node without onlined memory.
> >    */
> > -int mem_online_node(int nid)
> > +int try_online_node(int nid)
> >   {
> >   	pg_data_t	*pgdat;
> >   	int	ret;
> >   
> > +	if (node_online(nid))
> > +		return 0;
> > +
> >   	lock_memory_hotplug();
> >   	pgdat = hotadd_new_pgdat(nid, 0);
> >   	if (!pgdat) {

+               pr_err("Cannot online node %d due to NULL pgdat\n",
nid);

Thanks!
-Toshi

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

      parent reply	other threads:[~2013-09-10 13:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  0:24 Toshi Kani
2013-09-10  3:31 ` Yasuaki Ishimatsu
2013-09-10  3:34   ` Yasuaki Ishimatsu
2013-09-10 13:55   ` Toshi Kani [this message]

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=1378821337.10300.990.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rjw@sisk.pl \
    /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