From: Paul Jackson <pj@sgi.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: haveblue@us.ibm.com, linux-kernel@vger.kernel.org,
anton@samba.org, simon.derr@bull.net, nathanl@austin.ibm.com,
akpm@osdl.org, y-goto@jp.fujitsu.com
Subject: Re: memory hotplug - looking for good place for cpuset hook
Date: Fri, 25 Aug 2006 09:57:18 -0700 [thread overview]
Message-ID: <20060825095718.9e22e777.pj@sgi.com> (raw)
In-Reply-To: <20060825184717.3dbb5325.kamezawa.hiroyu@jp.fujitsu.com>
Kame wrote:
> maybe
>
> if (new_pgdat) {
> register_one_node(nid); <-- add sysfs entry of node
> <here>
> }
I am not sure why you suggest this, but perhaps you ar saying that I
don't need to call my new cpuset hook (that tracks node_online_map)
everytime we set a bit here in node_online_map, but only when we set a
bit that wasn't previously set.
Hmmm ... this mm/memory_hotplug.c:add_memory() code seems to have
more code than it needs:
================================================================
int add_memory(int nid, u64 start, u64 size)
{
pg_data_t *pgdat = NULL;
int new_pgdat = 0;
...
if (!node_online(nid)) {
pgdat = hotadd_new_pgdat(nid, start);
if (!pgdat)
return -ENOMEM;
new_pgdat = 1;
...
}
...
/* we online node here. we can't roll back from here. */
node_set_online(nid);
if (new_pgdat) {
ret = register_one_node(nid);
================================================================
It looks like the call to node_set_online() could also be called
only if it wasn't already set, and that the 'new_pgdat' is not
needed as we can just test for pgdat != NULL.
That leads to this code that's a couple lines shorter:
================================================================
int add_memory(int nid, u64 start, u64 size)
{
pg_data_t *pgdat = NULL;
...
if (!node_online(nid)) {
pgdat = hotadd_new_pgdat(nid, start);
if (!pgdat)
return -ENOMEM;
...
}
...
if (pgdat) {
/* we online node here. we can't roll back from here. */
node_set_online(nid);
ret = register_one_node(nid);
================================================================
Is this second code chunk just as good?
I'd still be inclined to add my new cpuset hook to track
node_online_map right after the node_set_online() call, since
that's what changes node_online_map. I don't think I care
whether or not the "sysfs entry of node" is setup or not.
> (When I implements node-hotplug invoked by cpu-hotplug, I'll care cpuset.)
Good - thanks.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
next prev parent reply other threads:[~2006-08-25 16:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-25 8:53 Paul Jackson
2006-08-25 9:47 ` KAMEZAWA Hiroyuki
2006-08-25 14:58 ` Dave Hansen
2006-08-25 17:23 ` Paul Jackson
2006-08-25 16:57 ` Paul Jackson [this message]
2006-08-25 17:57 ` KAMEZAWA Hiroyuki
2006-08-25 19:01 ` Paul Jackson
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=20060825095718.9e22e777.pj@sgi.com \
--to=pj@sgi.com \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=haveblue@us.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathanl@austin.ibm.com \
--cc=simon.derr@bull.net \
--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
all inboxes | Powered by JetHome®