From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with ESMTP id 139668D0040 for ; Wed, 30 Mar 2011 20:19:57 -0400 (EDT) Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id C6AC03EE0BD for ; Thu, 31 Mar 2011 09:19:52 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id ABD3F45DE54 for ; Thu, 31 Mar 2011 09:19:52 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 88E1345DE4F for ; Thu, 31 Mar 2011 09:19:52 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 72ACB1DB8040 for ; Thu, 31 Mar 2011 09:19:52 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.240.81.145]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 29AE11DB803B for ; Thu, 31 Mar 2011 09:19:52 +0900 (JST) Date: Thu, 31 Mar 2011 09:13:23 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH 1/4] vmscan: all_unreclaimable() use zone->all_unreclaimable as the name Message-Id: <20110331091323.a3b5cd0e.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20110329194044.2B82.A69D9226@jp.fujitsu.com> References: <20110329193953.2B7E.A69D9226@jp.fujitsu.com> <20110329194044.2B82.A69D9226@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: KOSAKI Motohiro Cc: Andrey Vagin , Minchan Kim , "Luis Claudio R. Goncalves" , LKML , linux-mm , David Rientjes , Oleg Nesterov , Andrew Morton , Linus Torvalds On Tue, 29 Mar 2011 19:40:04 +0900 (JST) KOSAKI Motohiro wrote: > all_unreclaimable check in direct reclaim has been introduced at 2.6.19 > by following commit. > > 2006 Sep 25; commit 408d8544; oom: use unreclaimable info > > And it went through strange history. firstly, following commit broke > the logic unintentionally. > > 2008 Apr 29; commit a41f24ea; page allocator: smarter retry of > costly-order allocations > > Two years later, I've found obvious meaningless code fragment and > restored original intention by following commit. > > 2010 Jun 04; commit bb21c7ce; vmscan: fix do_try_to_free_pages() > return value when priority==0 > > But, the logic didn't works when 32bit highmem system goes hibernation > and Minchan slightly changed the algorithm and fixed it . > > 2010 Sep 22: commit d1908362: vmscan: check all_unreclaimable > in direct reclaim path > > But, recently, Andrey Vagin found the new corner case. Look, > > struct zone { > .. > int all_unreclaimable; > .. > unsigned long pages_scanned; > .. > } > > zone->all_unreclaimable and zone->pages_scanned are neigher atomic > variables nor protected by lock. Therefore zones can become a state > of zone->page_scanned=0 and zone->all_unreclaimable=1. In this case, > current all_unreclaimable() return false even though > zone->all_unreclaimabe=1. > > Is this ignorable minor issue? No. Unfortunatelly, x86 has very > small dma zone and it become zone->all_unreclamble=1 easily. and > if it become all_unreclaimable=1, it never restore all_unreclaimable=0. > Why? if all_unreclaimable=1, vmscan only try DEF_PRIORITY reclaim and > a-few-lru-pages>>DEF_PRIORITY always makes 0. that mean no page scan > at all! > > Eventually, oom-killer never works on such systems. That said, we > can't use zone->pages_scanned for this purpose. This patch restore > all_unreclaimable() use zone->all_unreclaimable as old. and in addition, > to add oom_killer_disabled check to avoid reintroduce the issue of > commit d1908362. > > Reported-by: Andrey Vagin > Cc: Nick Piggin > Reviewed-by: Minchan Kim > Cc: KAMEZAWA Hiroyuki > Signed-off-by: KOSAKI Motohiro I think I saw this and this change of condition can avoid it. Reviewed-by: KAMEZAWA Hiroyuki -- 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