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 C6F06C433FE for ; Tue, 30 Nov 2021 11:23:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D69426B0073; Tue, 30 Nov 2021 06:23:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D18486B0074; Tue, 30 Nov 2021 06:23:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDFEB6B0075; Tue, 30 Nov 2021 06:23:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id AC7BC6B0073 for ; Tue, 30 Nov 2021 06:23:00 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 578768D6D0 for ; Tue, 30 Nov 2021 11:22:50 +0000 (UTC) X-FDA: 78865359300.13.0C69A38 Received: from outbound-smtp44.blacknight.com (outbound-smtp44.blacknight.com [46.22.136.52]) by imf29.hostedemail.com (Postfix) with ESMTP id F3F4E9000678 for ; Tue, 30 Nov 2021 11:22:44 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp44.blacknight.com (Postfix) with ESMTPS id 4F1B1F8541 for ; Tue, 30 Nov 2021 11:22:47 +0000 (GMT) Received: (qmail 5292 invoked from network); 30 Nov 2021 11:22:47 -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); 30 Nov 2021 11:22:46 -0000 Date: Tue, 30 Nov 2021 11:22:44 +0000 From: Mel Gorman To: Mike Galbraith Cc: Alexey Avramov , Andrew Morton , Michal Hocko , Vlastimil Babka , Rik van Riel , Darrick Wong , regressions@lists.linux.dev, Linux-fsdevel , Linux-MM , LKML Subject: Re: [PATCH 1/1] mm: vmscan: Reduce throttling due to a failure to make progress Message-ID: <20211130112244.GQ3366@techsingularity.net> References: <20211125151853.8540-1-mgorman@techsingularity.net> <20211127011246.7a8ac7b8@mail.inbox.lv> <20211129150117.GO3366@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-Queue-Id: F3F4E9000678 X-Stat-Signature: 3wdg5o7upqaq9aauxrswur8y8km4fky6 Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf29.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.52 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam02 X-HE-Tag: 1638271364-638640 Content-Transfer-Encoding: quoted-printable 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 Tue, Nov 30, 2021 at 11:14:32AM +0100, Mike Galbraith wrote: > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > index fb9584641ac7..1af12072f40e 100644 > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -1021,6 +1021,39 @@ static void handle_write_error(struct address_= space *mapping, > > =A0=A0=A0=A0=A0=A0=A0=A0unlock_page(page); > > =A0} > > =A0 > > +bool skip_throttle_noprogress(pg_data_t *pgdat) > > +{ > > +=A0=A0=A0=A0=A0=A0=A0int reclaimable =3D 0, write_pending =3D 0; > > +=A0=A0=A0=A0=A0=A0=A0int i; > > + > > +=A0=A0=A0=A0=A0=A0=A0/* > > +=A0=A0=A0=A0=A0=A0=A0 * If kswapd is disabled, reschedule if necessa= ry but do not > > +=A0=A0=A0=A0=A0=A0=A0 * throttle as the system is likely near OOM. > > +=A0=A0=A0=A0=A0=A0=A0 */ > > +=A0=A0=A0=A0=A0=A0=A0if (pgdat->kswapd_failures >=3D MAX_RECLAIM_RET= RIES) > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return true; > > + > > +=A0=A0=A0=A0=A0=A0=A0/* > > +=A0=A0=A0=A0=A0=A0=A0 * If there are a lot of dirty/writeback pages = then do not > > +=A0=A0=A0=A0=A0=A0=A0 * throttle as throttling will occur when the p= ages cycle > > +=A0=A0=A0=A0=A0=A0=A0 * towards the end of the LRU if still under wr= iteback. > > +=A0=A0=A0=A0=A0=A0=A0 */ > > +=A0=A0=A0=A0=A0=A0=A0for (i =3D 0; i < MAX_NR_ZONES; i++) { > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0struct zone *zone =3D p= gdat->node_zones + i; > > + > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (!populated_zone(zon= e)) > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= continue; > > + > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0reclaimable +=3D zone_r= eclaimable_pages(zone); > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0write_pending +=3D zone= _page_state_snapshot(zone, > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= NR_ZONE_WRITE_PENDING); > > +=A0=A0=A0=A0=A0=A0=A0} > > +=A0=A0=A0=A0=A0=A0=A0if (2 * write_pending <=3D reclaimable) >=20 > That is always true here... >=20 Always true for you or always true in general? The intent of the check is "are a majority of reclaimable pages marked WRITE_PENDING?". It's similar to the check that existed prior to 132b0d21d21f ("mm/page_alloc: remove the throttling logic from the page allocator"). --=20 Mel Gorman SUSE Labs