Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754446AbdCNDFP (ORCPT ); Mon, 13 Mar 2017 23:05:15 -0400 Received: from out0-151.mail.aliyun.com ([140.205.0.151]:37705 "EHLO out0-151.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753175AbdCNDFN (ORCPT ); Mon, 13 Mar 2017 23:05:13 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03298;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---.7ntRsmW_1489460682; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Shakeel Butt'" , "'Johannes Weiner'" , "'Mel Gorman'" , "'Michal Hocko'" , "'Vlastimil Babka'" , "'Andrew Morton'" Cc: "'Jia He'" , , References: <20170313221920.7881-1-shakeelb@google.com> In-Reply-To: <20170313221920.7881-1-shakeelb@google.com> Subject: Re: [PATCH v2] mm: fix condition for throttle_direct_reclaim Date: Tue, 14 Mar 2017 11:04:42 +0800 Message-ID: <09b201d29c6f$babfa370$303eea50$@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: AQFoSqNjOsk+RVMDPpQVu8E1BlcruaJoSYFA Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 868 Lines: 19 On March 14, 2017 6:19 AM Shakeel Butt wrote: > > Recently kswapd has been modified to give up after MAX_RECLAIM_RETRIES > number of unsucessful iterations. Before going to sleep, kswapd thread > will unconditionally wakeup all threads sleeping on pfmemalloc_wait. > However the awoken threads will recheck the watermarks and wake the > kswapd thread and sleep again on pfmemalloc_wait. There is a chance > of continuous back and forth between kswapd and direct reclaiming > threads if the kswapd keep failing and thus defeat the purpose of > adding backoff mechanism to kswapd. So, add kswapd_failures check > on the throttle_direct_reclaim condition. > > Signed-off-by: Shakeel Butt > Suggested-by: Michal Hocko > Suggested-by: Johannes Weiner > --- Acked-by: Hillf Danton