From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbdBDDJ5 (ORCPT ); Fri, 3 Feb 2017 22:09:57 -0500 Received: from out0-150.mail.aliyun.com ([140.205.0.150]:41453 "EHLO out0-150.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753387AbdBDDJz (ORCPT ); Fri, 3 Feb 2017 22:09:55 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03302;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.7YULZ4h_1486177767; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Mel Gorman'" , "'Andrew Morton'" Cc: "'Johannes Weiner'" , "'Michal Hocko'" , "'Minchan Kim'" , "'Rik van Riel'" , , References: <20170203203222.gq7hk66yc36lpgtb@suse.de> In-Reply-To: <20170203203222.gq7hk66yc36lpgtb@suse.de> Subject: Re: [PATCH] mm, vmscan: Clear PGDAT_WRITEBACK when zone is balanced Date: Sat, 04 Feb 2017 11:09:27 +0800 Message-ID: <007701d27e94$18ea17e0$4abe47a0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKNbxEKuFR90VGfonAQFvq7iiuwdp/iSRPw Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On February 04, 2017 4:32 AM Mel Gorman wrote: > > Hillf Danton pointed out that since commit 1d82de618dd ("mm, vmscan: > make kswapd reclaim in terms of nodes") that PGDAT_WRITEBACK is no longer > cleared. It was not noticed as triggering it requires pages under writeback > to cycle twice through the LRU and before kswapd gets stalled. Historically, > such issues tended to occur on small machines writing heavily to slow > storage such as a USB stick. Once kswapd stalls, direct reclaim stalls may > be higher but due to the fact that memory pressure is requires, it would not > be very noticable. Michal Hocko suggested removing the flag entirely but > the conservative fix is to restore the intended PGDAT_WRITEBACK behaviour > and clear the flag when a suitable zone is balanced. > > Signed-off-by: Mel Gorman > --- Acked-by: Hillf Danton > mm/vmscan.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 532a2a750952..3379fa5ce6d8 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3103,6 +3103,7 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx) > */ > clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags); > clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags); > + clear_bit(PGDAT_WRITEBACK, &zone->zone_pgdat->flags); > > return true; > } >