From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail190.messagelabs.com (mail190.messagelabs.com [216.82.249.51]) by kanga.kvack.org (Postfix) with ESMTP id 354F88D003B for ; Mon, 28 Mar 2011 02:40:09 -0400 (EDT) Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id EEEE03EE0C2 for ; Mon, 28 Mar 2011 15:40:05 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 9035145DE67 for ; Mon, 28 Mar 2011 15:40:01 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 529F345DE4D for ; Mon, 28 Mar 2011 15:40:01 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id EEF84E18004 for ; Mon, 28 Mar 2011 15:40:00 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.240.81.145]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id BC8CEE18001 for ; Mon, 28 Mar 2011 15:40:00 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [PATCH 1/2] check the return value of soft_limit reclaim In-Reply-To: <1301292775-4091-2-git-send-email-yinghan@google.com> References: <1301292775-4091-1-git-send-email-yinghan@google.com> <1301292775-4091-2-git-send-email-yinghan@google.com> Message-Id: <20110328154033.F068.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Mon, 28 Mar 2011 15:39:59 +0900 (JST) Sender: owner-linux-mm@kvack.org List-ID: To: Ying Han Cc: kosaki.motohiro@jp.fujitsu.com, Minchan Kim , Rik van Riel , Mel Gorman , KAMEZAWA Hiroyuki , Andrew Morton , linux-mm@kvack.org > In the global background reclaim, we do soft reclaim before scanning the > per-zone LRU. However, the return value is ignored. This patch adds the logic > where no per-zone reclaim happens if the soft reclaim raise the free pages > above the zone's high_wmark. > > I did notice a similar check exists but instead leaving a "gap" above the > high_wmark(the code right after my change in vmscan.c). There are discussions > on whether or not removing the "gap" which intends to balance pressures across > zones over time. Without fully understand the logic behind, I didn't try to > merge them into one, but instead adding the condition only for memcg users > who care a lot on memory isolation. > > Signed-off-by: Ying Han Looks good to me. But this depend on "memcg soft limit" spec. To be honest, I don't know this return value ignorance is intentional or not. So I think you need to get ack from memcg folks. > --- > mm/vmscan.c | 16 +++++++++++++++- > 1 files changed, 15 insertions(+), 1 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 060e4c1..e4601c5 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2320,6 +2320,7 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, > int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ > unsigned long total_scanned; > struct reclaim_state *reclaim_state = current->reclaim_state; > + unsigned long nr_soft_reclaimed; > struct scan_control sc = { > .gfp_mask = GFP_KERNEL, > .may_unmap = 1, > @@ -2413,7 +2414,20 @@ loop_again: > * Call soft limit reclaim before calling shrink_zone. > * For now we ignore the return value > */ > - mem_cgroup_soft_limit_reclaim(zone, order, sc.gfp_mask); > + nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(zone, > + order, sc.gfp_mask); > + > + /* > + * Check the watermark after the soft limit reclaim. If > + * the free pages is above the watermark, no need to > + * proceed to the zone reclaim. > + */ > + if (nr_soft_reclaimed && zone_watermark_ok_safe(zone, > + order, high_wmark_pages(zone), > + end_zone, 0)) { > + __inc_zone_state(zone, NR_SKIP_RECLAIM_GLOBAL); NR_SKIP_RECLAIM_GLOBAL is defined by patch 2/2. please don't break bisectability. > + continue; > + } > > /* > * We put equal pressure on every zone, unless > -- > 1.7.3.1 > -- 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 internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org