linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: Bob Liu <lliubbo@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>,
	kamezawa.hiroyu@jp.fujitsu.com, minchan.kim@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	andi@firstfloor.org, rientjes@google.com,
	lee.schermerhorn@hp.com
Subject: Re: [PATCH] mempolicy:add GFP_THISNODE when allocing new page
Date: Mon, 19 Apr 2010 12:47:55 -0500 (CDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1004191245250.9855@router.home> (raw)
In-Reply-To: <m2vcf18f8341004170654tc743e4b0s73a0e234cfdcda93@mail.gmail.com>

On Sat, 17 Apr 2010, Bob Liu wrote:

> > GFP_THISNODE forces allocation from the node. Without it we will fallback.
> >
>
> Yeah, but I think we shouldn't fallback at this case, what we want is
> alloc a page
> from exactly the dest node during migrate_to_node(dest).So I added
> GFP_THISNODE.

Why would we want that?

>
> And mel concerned that
> ====
> This appears to be a valid bug fix.  I agree that the way things are structured
> that __GFP_THISNODE should be used in new_node_page(). But maybe a follow-on
> patch is also required. The behaviour is now;
>
> o new_node_page will not return NULL if the target node is empty (fine).
> o migrate_pages will translate this into -ENOMEM (fine)
> o do_migrate_pages breaks early if it gets -ENOMEM ?
>
> It's the last part I'd like you to double check. migrate_pages() takes a
> nodemask of allowed nodes to migrate to. Rather than sending this down
> to the allocator, it iterates over the nodes allowed in the mask. If one
> of those nodes is full, it returns -ENOMEM.
>
> If -ENOMEM is returned from migrate_pages, should it not move to the
> next node?
> ====

?? It will move onto the next node if you leave things as is. If you add
GFP_THISNODE then you can get NULL back from the page allocator because
there is no memory on the local node. Without GFP_THISNODe the allocation
will fallback.

> In my opinion, when we want to preserve the relative position of the page to
> the beginning of the node set, early return is ok. Else should try to alloc the
> new page from the next node(to_nodes).

???

> So I added retry path to allocate new page from next node only when
> from_nodes' weight is different from to_nodes', this case the user should
> konw the relative position of the page to the beginning of the node set
> can be changed.

There is no point in your patch since the functionality is already there
without it.

--
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:[~2010-04-19 17:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06  2:59 Bob Liu
2010-04-06  4:33 ` Minchan Kim
2010-04-06  4:56   ` Bob Liu
2010-04-06  5:06     ` Minchan Kim
2010-04-13  8:19 ` KAMEZAWA Hiroyuki
2010-04-13  8:20 ` Bob Liu
2010-04-13  8:38   ` Mel Gorman
2010-04-13 14:28     ` Bob Liu
2010-04-16  0:41       ` Christoph Lameter
2010-04-16  1:02         ` Bob Liu
2010-04-16 16:02           ` Christoph Lameter
2010-04-16 11:15       ` Mel Gorman
2010-04-16 15:03         ` Bob Liu
2010-04-16 15:55           ` Christoph Lameter
2010-04-17 13:54             ` Bob Liu
2010-04-19 17:47               ` Christoph Lameter [this message]
2010-04-20  2:08                 ` Bob Liu
2010-04-21 14:13                   ` Christoph Lameter
2010-04-22  1:03                     ` Bob Liu
2010-04-22 14:38                       ` Christoph Lameter
2010-04-13  8:27 ` Minchan Kim

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=alpine.DEB.2.00.1004191245250.9855@router.home \
    --to=cl@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lee.schermerhorn@hp.com \
    --cc=linux-mm@kvack.org \
    --cc=lliubbo@gmail.com \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=rientjes@google.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