From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCFD2C11D07 for ; Thu, 20 Feb 2020 10:19:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5FEAD20801 for ; Thu, 20 Feb 2020 10:19:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FEAD20801 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB7D66B0005; Thu, 20 Feb 2020 05:19:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D68996B0006; Thu, 20 Feb 2020 05:19:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7DBB6B0007; Thu, 20 Feb 2020 05:19:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id AF1D86B0005 for ; Thu, 20 Feb 2020 05:19:52 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 875078248047 for ; Thu, 20 Feb 2020 10:19:52 +0000 (UTC) X-FDA: 76510109424.24.pull85_9060bc562af2b X-HE-Tag: pull85_9060bc562af2b X-Filterd-Recvd-Size: 3464 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 10:19:51 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 12DF2B285; Thu, 20 Feb 2020 10:19:50 +0000 (UTC) Date: Thu, 20 Feb 2020 10:19:45 +0000 From: Mel Gorman To: Sultan Alsawaf Cc: Michal Hocko , Dave Hansen , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner Subject: Re: [PATCH] mm: Stop kswapd early when nothing's waiting for it to free pages Message-ID: <20200220101945.GN3420@suse.de> References: <20200219182522.1960-1-sultan@kerneltoast.com> <20200219194006.GA3075@sultan-book.localdomain> <20200219200527.GF11847@dhcp22.suse.cz> <20200219204220.GA3488@sultan-book.localdomain> <20200219214513.GL3420@suse.de> <20200219224231.GA5190@sultan-book.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20200219224231.GA5190@sultan-book.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 19, 2020 at 02:42:31PM -0800, Sultan Alsawaf wrote: > On Wed, Feb 19, 2020 at 09:45:13PM +0000, Mel Gorman wrote: > > This could be watermark boosting run wild again. Can you test with > > sysctl vm.watermark_boost_factor=0 or the following patch? (preferably > > both to compare and contrast). > > I can test that, but something to note is that I've been doing equal testing > with this on 4.4, which exhibits the same behavior, and that kernel doesn't have > watermark boosting in it, as far as I can tell. > > I don't think what we're addressing here is a "bug", but rather something > fundamental about how we've been thinking about kswapd lifetime. The argument > here is that it's not coherent to be letting kswapd run as it does, and instead > gating it on outstanding allocation requests provides much more reasonable > behavior, given real workloads and use patterns. > > Does that make sense and seem reasonable? > I'm not entirely convinced. The reason the high watermark exists is to have kswapd work long enough to make progress without a process having to direct reclaim. The most straight-forward example would be a streaming reader of a large file. It'll keep pushing the zone towards the low watermark and kswapd has to keep ahead of the reader. If we cut kswapd off too quickly, the min watermark is hit and stalls occur. While kswapd could stop at the min watermark, it leaves a very short window for kswapd to make enough progress before the min watermark is hit. At minimum, any change in this area would need to include the /proc/vmstats on allocstat and pg*direct* to ensure that direct reclaim stalls are not worse. I'm not a fan of the patch in question because kswapd can be woken between the low and min watermark without stalling but we really do expect kswapd to make progress and continue to make progress to avoid future stalls. The changelog had no information on the before/after impact of the patch and this is an area where intuition can disagree with real behaviour. -- Mel Gorman SUSE Labs