linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: kosaki.motohiro@jp.fujitsu.com, Mel Gorman <mel@csn.ul.ie>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Minchan Kim <minchan.kim@gmail.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	linux-mm@kvack.org
Subject: Re: [patch] mm: fix deferred congestion timeout if preferred zone is not allowed
Date: Wed, 19 Jan 2011 22:01:17 +0900 (JST)	[thread overview]
Message-ID: <20110119215500.2833.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1101181211100.18781@chino.kir.corp.google.com>

> > > This patch resets preferred_zone to an allowed zone in the slowpath if
> > > the allocation context is constrained by current's cpuset. 
> > 
> > Well, preferred_zone has meaning. If it's not possible to allocate from
> > that zone in the current cpuset context, it's not really preferred. Why
> > not set it in the fast path so there isn't a useless call to
> > get_page_from_freelist()?
> > 
> 
> It may be the preferred zone even if it isn't allowed by current's cpuset 
> such as if the allocation is __GFP_WAIT or the task has been oom killed 
> and has the TIF_MEMDIE bit set, so the preferred zone in the fastpath is 
> accurate in these cases.  In the slowpath, the former is protected by 
> checking for ALLOC_CPUSET and the latter is usually only set after the 
> page allocator has looped at least once and triggered the oom killer to be 
> killed.
> 
> I didn't want to add a branch to test for these possibilities in the 
> fastpath, however, since preferred_zone isn't of critical importance until 
> it's used in the slowpath (ignoring the statistical usage).

I'm glad to you are keeping fastpath concern. However you don't need
nodemask-and in this case. Because zonelist->zref[0] is always in nodemask.
Please see policy_zonelist(). So, you can just replace nodemask with cpuset_mems_allowed.

This is not only simple, but also improve a consisteny of mempolicy.

---
 mm/page_alloc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 07a6544..876de04 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2146,7 +2146,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 
 	get_mems_allowed();
 	/* The preferred zone is used for statistics later */
-	first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone);
+	first_zones_zonelist(zonelist, high_zoneidx,
+			     &cpuset_current_mems_allowed, &preferred_zone);
 	if (!preferred_zone) {
 		put_mems_allowed();
 		return NULL;
-- 
1.6.5.2




--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-01-19 13:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18  5:09 David Rientjes
2011-01-18  6:04 ` KOSAKI Motohiro
2011-01-18 10:29   ` Mel Gorman
2011-01-19 12:48     ` KOSAKI Motohiro
2011-01-18 10:15 ` Mel Gorman
2011-01-18 20:24   ` David Rientjes
2011-01-18 20:42     ` Mel Gorman
2011-01-19  1:51       ` David Rientjes
2011-01-19 13:01     ` KOSAKI Motohiro [this message]
2011-01-19 18:37       ` David Rientjes
2011-01-19 12:52   ` KOSAKI Motohiro
2011-01-19  0:43 ` Minchan Kim
2011-01-19  1:53   ` David Rientjes
2011-01-19  4:10     ` Minchan Kim
2011-01-19 19:59     ` Christoph Lameter
2011-01-19 20:06       ` Andi Kleen
2011-01-19 20:18         ` David Rientjes
2011-01-19 23:07           ` Christoph Lameter
2011-01-20  0:59           ` Minchan Kim
2011-01-23 22:30 ` [patch v2] " David Rientjes
2011-01-24 17:16   ` Rik van Riel

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=20110119215500.2833.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=riel@redhat.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