From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>,
Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
Miao Xie <miaox@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Christoph Lameter <cl@linux-foundation.org>,
Paul Menage <menage@google.com>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Yasunori Goto <y-goto@jp.fujitsu.com>,
Pekka Enberg <penberg@cs.helsinki.fi>,
linux-mm <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [BUG] set_mempolicy(MPOL_INTERLEAV) cause kernel panic
Date: Fri, 17 Jul 2009 11:39:11 +0900 [thread overview]
Message-ID: <20090717113911.c49395ae.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20090717104512.A914.A69D9226@jp.fujitsu.com>
On Fri, 17 Jul 2009 11:07:09 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> > On Fri, 17 Jul 2009 09:04:46 +0900 (JST)
> > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> >
> > > > On Wed, 15 Jul 2009, Lee Schermerhorn wrote:
> > > >
> > > > > Interestingly, on ia64, the top cpuset mems_allowed gets set to all
> > > > > possible nodes, while on x86_64, it gets set to on-line nodes [or nodes
> > > > > with memory]. Maybe this is a to support hot-plug?
> > > > >
> > > >
> > > > numactl --interleave=all simply passes a nodemask with all bits set, so if
> > > > cpuset_current_mems_allowed includes offline nodes from node_possible_map,
> > > > then mpol_set_nodemask() doesn't mask them off.
> > > >
> > > > Seems like we could handle this strictly in mempolicies without worrying
> > > > about top_cpuset like in the following?
> > >
> > > This patch seems band-aid patch. it will change memory-hotplug behavior.
> > > Please imazine following scenario:
> > >
> > > 1. numactl interleave=all process-A
> > > 2. memory hot-add
> > >
> > > before 2.6.30:
> > > -> process-A can use hot-added memory
> > >
> > > your proposal patch:
> > > -> process-A can't use hot-added memory
> > >
> >
> > IMHO, the application itseld should be notifed to change its mempolicy by
> > hot-plug script on the host. While an application uses interleave, a new node
> > hot-added is just a noise. I think "How pages are interleaved" should not be
> > changed implicitly. Then, checking at set_mempolicy() seems sane. If notified,
> > application can do page migration and rebuild his mapping in ideal way.
>
> Do you really want ABI change?
>
No ;_
Hmm, IIUC, current handling of nodemask of mempolicy is below.
There should be 3 masks.
- systems's N_HIGH_MEMORY
- the mask user specified via mempolicy() (remembered only when MPOL_F_RELATIVE
- cpusets's one
And pol->v.nodes is just a _cache_ of logical-and of aboves.
Synchronization with cpusets is guaranteed by cpuset's generation.
Synchronization with N_HIGH_MEMORY should be guaranteed by memory hotplug
notifier, but this is not implemented yet.
Then, what I can tell here is...
- remember what's user requested. (only when MPOL_F_RELATIVE_NODES ?)
- add notifiers for memory hot-add. (only when MPOL_F_RELATIVE_NODES ?)
- add notifiers for memory hot-remove (both MPOL_F_STATIC/RELATIVE_NODES ?)
IMHO, for cpusets, don't calculate v.nodes again if MPOL_F_STATIC is good.
But for N_HIGH_MEMORY, v.nodes should be caluculated even if MPOL_F_STATIC is set.
Then, I think the mask user passed should be remembered even if MPOL_F_STATIC is
set and v.nodes should work as cache and should be updated in appropriate way.
Thanks,
-Kame
--
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:[~2009-07-17 2:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-15 9:48 KOSAKI Motohiro
2009-07-15 17:31 ` Lee Schermerhorn
2009-07-16 1:00 ` KOSAKI Motohiro
2009-07-16 20:05 ` David Rientjes
2009-07-17 0:04 ` KOSAKI Motohiro
2009-07-17 0:57 ` KAMEZAWA Hiroyuki
2009-07-17 2:07 ` KOSAKI Motohiro
2009-07-17 2:39 ` KAMEZAWA Hiroyuki [this message]
2009-07-17 9:09 ` David Rientjes
2009-07-17 9:01 ` David Rientjes
2009-07-24 22:51 ` David Rientjes
2009-07-24 23:09 ` Andrew Morton
2009-07-25 1:33 ` KAMEZAWA Hiroyuki
2009-07-25 2:35 ` KAMEZAWA Hiroyuki
2009-07-25 3:15 ` KAMEZAWA Hiroyuki
2009-07-25 13:21 ` KOSAKI Motohiro
2009-07-25 14:40 ` KAMEZAWA Hiroyuki
2009-07-27 18:00 ` David Rientjes
2009-07-27 17:55 ` David Rientjes
2009-07-27 23:58 ` KAMEZAWA Hiroyuki
2009-07-28 0:14 ` David Rientjes
2009-07-28 0:25 ` KAMEZAWA Hiroyuki
2009-07-28 0:38 ` David Rientjes
2009-07-28 0:54 ` KAMEZAWA Hiroyuki
2009-07-28 1:02 ` David Rientjes
2009-07-28 1:11 ` KAMEZAWA Hiroyuki
2009-07-28 1:24 ` KAMEZAWA Hiroyuki
2009-07-28 7:18 ` [BUGFIX] set_mempolicy(MPOL_INTERLEAV) N_HIGH_MEMORY aware KAMEZAWA Hiroyuki
2009-07-28 8:52 ` Andi Kleen
2009-07-28 10:04 ` KAMEZAWA Hiroyuki
2009-07-29 20:16 ` Andrew Morton
2009-07-30 0:06 ` KAMEZAWA Hiroyuki
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=20090717113911.c49395ae.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=miaox@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=penberg@cs.helsinki.fi \
--cc=rientjes@google.com \
--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