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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69D5DC433F5 for ; Tue, 7 Dec 2021 09:28:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE1666B0095; Tue, 7 Dec 2021 04:28:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B69D36B0096; Tue, 7 Dec 2021 04:28:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0A0C6B0098; Tue, 7 Dec 2021 04:28:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 8C9F16B0095 for ; Tue, 7 Dec 2021 04:28:18 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4210089941 for ; Tue, 7 Dec 2021 09:28:08 +0000 (UTC) X-FDA: 78890471856.16.95C8BA4 Received: from outbound-smtp26.blacknight.com (outbound-smtp26.blacknight.com [81.17.249.194]) by imf27.hostedemail.com (Postfix) with ESMTP id A2F77700009B for ; Tue, 7 Dec 2021 09:28:07 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp26.blacknight.com (Postfix) with ESMTPS id 50FF3CAF36 for ; Tue, 7 Dec 2021 09:28:06 +0000 (GMT) Received: (qmail 18135 invoked from network); 7 Dec 2021 09:28:06 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 7 Dec 2021 09:28:05 -0000 Date: Tue, 7 Dec 2021 09:28:03 +0000 From: Mel Gorman To: Shakeel Butt Cc: Andrew Morton , Michal Hocko , Vlastimil Babka , Alexey Avramov , Rik van Riel , Mike Galbraith , Darrick Wong , regressions@lists.linux.dev, Linux-fsdevel , Linux-MM , LKML Subject: Re: [PATCH v4 1/1] mm: vmscan: Reduce throttling due to a failure to make progress Message-ID: <20211207092803.GI3366@techsingularity.net> References: <20211202150614.22440-1-mgorman@techsingularity.net> <20211202165220.GZ3366@techsingularity.net> <20211203090137.GA3366@techsingularity.net> <20211203190807.GE3366@techsingularity.net> <20211206112545.GF3366@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A2F77700009B X-Stat-Signature: quboionpfgnednyhhrc5ssg3bru1xqys Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.194 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none X-HE-Tag: 1638869287-637119 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 Mon, Dec 06, 2021 at 11:14:58PM -0800, Shakeel Butt wrote: > On Mon, Dec 6, 2021 at 3:25 AM Mel Gorman wrote: > > > > On Sun, Dec 05, 2021 at 10:06:27PM -0800, Shakeel Butt wrote: > > > On Fri, Dec 3, 2021 at 11:08 AM Mel Gorman wrote: > > > > > > > [...] > > > > > I am in agreement with the motivation of the whole series. I am just > > > > > making sure that the motivation of VMSCAN_THROTTLE_NOPROGRESS based > > > > > throttle is more than just the congestion_wait of > > > > > mem_cgroup_force_empty_write. > > > > > > > > > > > > > The commit that primarily targets congestion_wait is 8cd7c588decf > > > > ("mm/vmscan: throttle reclaim until some writeback completes if > > > > congested"). The series recognises that there are other reasons why > > > > reclaim can fail to make progress that is not directly writeback related. > > > > > > > > > > I agree with throttling for VMSCAN_THROTTLE_[WRITEBACK|ISOLATED] > > > reasons. Please explain why we should throttle for > > > VMSCAN_THROTTLE_NOPROGRESS? Also 69392a403f49 claims "Direct reclaim > > > primarily is throttled in the page allocator if it is failing to make > > > progress.", can you please explain how? > > > > It could happen if the pages on the LRU are being reactivated continually > > or holding an elevated reference count for some reason (e.g. gup, > > page migration etc). The event is probably transient, hence the short > > throttling. > > > > What's the worst that can happen if the kernel doesn't throttle at all > for these transient scenarios? Premature oom-kills? Excessive CPU usage in reclaim, potential premature OOM kills. > The kernel already > has some protection against such situations with retries i.e. > consecutive 16 unsuccessful reclaim tries have to fail to give up the > reclaim. > The retries mitigate the premature OOM kills but not the excessive CPU usage. > Anyways, I have shared my view which is 'no need to throttle at all > for no-progress reclaims for now and course correct if there are > complaints in future' but will not block the patch. > We've gone through periods of bugs that had either direct reclaim or kswapd pegged at 100% CPU usage. While kswapd now just stops, the patch still minimises the risk of excessive CPU usage bugs due to direct reclaim. -- Mel Gorman SUSE Labs