Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp498027ybv; Thu, 20 Feb 2020 02:20:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz1mQudSgFOHycmwuG8uBw8DGBtdoLtIrBEn7EwlVxJRCNPOyiqzr8L6kBKOYqzZSo+Y0wj X-Received: by 2002:a05:6830:1498:: with SMTP id s24mr24493699otq.79.1582194010019; Thu, 20 Feb 2020 02:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582194010; cv=none; d=google.com; s=arc-20160816; b=T7aCSIbU4VnaPkbHITJhtiSNRFvko39kIzt5AS4PyiPye/2WDoKqWccoowV6eTYnWA aU50lXiIcSH2kE1ITxbK+N6jx0Flrsx/4JtXXWe3eTVVMJGb1LpOO4DZAx/ohIaYf17v 2pY31MDTbeZE2TgMPa3/kYlFR6ZC4BCcV0m4MlTK3tVT1hPdnixJOIUNLowN+4Rc3J6h Y+i334Uxk/eRvR5yFdC+rXCGWSwgt3cLYKwxbCxwbYwUWVU/sI6fyc03XjTwZhcWKvma XVb2fYPqN3kKFsUJv3rZhpveWL347ZbOaYTcuhWwszqJLW1ReNnEGAgpE0rBUIY+fvA9 Zc5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=psp+eofO1AzkDjksgpUmI184x/eE0OHARVQqjI4qo28=; b=LrIj2QZkVIaToW8u2eEnZZpFsyyyd0Noglh4Wh+ZgxTIykP4jYaNdB9dNGlUlX6tOf d+20yVUnDCJQrwXj031x6wRBLjTGS+vYaiYymQ2QmuyxLlo2oPN/V0TBBTjQHb7v+GqK qWkDxgPIzZmYfspt+wwCT50w1cI44036jGVKVdo4cnVv+jOVSRVwbILG/Rm1u07+JVuG kH8i22IWyPY+8+0YMsBvMP8jpWXdugu6BJc/ChVdysvE9gruOLIavslFhW/HS6z3/l1h 0h/UX/iEGcUS2Tw3+Dpp3CXyp9avcR37hdDgns/qLJzUwNRqK1yOJAqP7RXsMFdM24L/ tuyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si1477017oth.158.2020.02.20.02.19.55; Thu, 20 Feb 2020 02:20:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgBTKTw (ORCPT + 99 others); Thu, 20 Feb 2020 05:19:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:41990 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgBTKTw (ORCPT ); Thu, 20 Feb 2020 05:19:52 -0500 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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