Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744Ab2FOH1E (ORCPT ); Fri, 15 Jun 2012 03:27:04 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:62789 "EHLO LGEMRELSE7Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478Ab2FOH1C (ORCPT ); Fri, 15 Jun 2012 03:27:02 -0400 X-AuditID: 9c930197-b7b87ae000000e4d-88-4fdae3c40503 Message-ID: <4FDAE3CC.60801@kernel.org> Date: Fri, 15 Jun 2012 16:27:08 +0900 From: Minchan Kim User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: gmane.linux.kernel.mm,gmane.linux.kernel To: KOSAKI Motohiro CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, Nick Piggin , Michal Hocko , Johannes Weiner , Mel Gorman , KAMEZAWA Hiroyuki , Minchan Kim Subject: Re: [resend][PATCH] mm, vmscan: fix do_try_to_free_pages() livelock References: <1339661592-3915-1-git-send-email-kosaki.motohiro@gmail.com> <20120614145716.GA2097@barrios> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2347 Lines: 57 On 06/15/2012 01:10 AM, KOSAKI Motohiro wrote: > On Thu, Jun 14, 2012 at 10:57 AM, Minchan Kim wrote: >> Hi KOSAKI, >> >> Sorry for late response. >> Let me ask a question about description. >> >> On Thu, Jun 14, 2012 at 04:13:12AM -0400, kosaki.motohiro@gmail.com wrote: >>> From: KOSAKI Motohiro >>> >>> Currently, do_try_to_free_pages() can enter livelock. Because of, >>> now vmscan has two conflicted policies. >>> >>> 1) kswapd sleep when it couldn't reclaim any page when reaching >>> priority 0. This is because to avoid kswapd() infinite >>> loop. That said, kswapd assume direct reclaim makes enough >>> free pages to use either regular page reclaim or oom-killer. >>> This logic makes kswapd -> direct-reclaim dependency. >>> 2) direct reclaim continue to reclaim without oom-killer until >>> kswapd turn on zone->all_unreclaimble. This is because >>> to avoid too early oom-kill. >>> This logic makes direct-reclaim -> kswapd dependency. >>> >>> In worst case, direct-reclaim may continue to page reclaim forever >>> when kswapd sleeps forever. >> >> I have tried imagined scenario you mentioned above with code level but >> unfortunately I got failed. >> If kswapd can't meet high watermark on order-0, it doesn't sleep if I don't miss something. > > pgdat_balanced() doesn't recognized zone. Therefore kswapd may sleep > if node has multiple zones. Hm ok, I realized my descriptions was > slightly misleading. priority 0 is not needed. bakance_pddat() calls > pgdat_balanced() > every priority. Most easy case is, movable zone has a lot of free pages and > normal zone has no reclaimable page. > > btw, current pgdat_balanced() logic seems not correct. kswapd should > sleep only if every zones have much free pages than high water mark > _and_ 25% of present pages in node are free. > Sorry. I can't understand your point. Current kswapd doesn't sleep if relevant zones don't have free pages above high watermark. It seems I am missing your point. Please anybody correct me. -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/