From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D17A173 for ; Fri, 31 Dec 2021 21:04:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E3D6C36AEA; Fri, 31 Dec 2021 21:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1640984669; bh=9LdS4YJ2dTX8nxYH2HymplEjjux9p/BXT0uHZJPppE4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HPd73zj0+Ds30HpWM2w3T3pzK97Th2xrvft4vEQqFUwCO3LLVx3QsMsQftC6YAJuA L76ehC6mRgp6Iy80AniCihq+049S8007yW/lNnye34QV+x86qlCKlmBFrizvHlhRte wH3yaNE8SRLLVoQ/5BYJGCQCG9om9f8amj6LPD2Q= Date: Fri, 31 Dec 2021 13:04:27 -0800 From: Andrew Morton To: Linus Torvalds Cc: Thorsten Leemhuis , Mel Gorman , Mark Brown , Michal Hocko , Vlastimil Babka , Alexey Avramov , Rik van Riel , Mike Galbraith , Darrick Wong , Linux regressions mailing list , Linux-fsdevel , Linux-MM , LKML Subject: Re: [PATCH v4 1/1] mm: vmscan: Reduce throttling due to a failure to make progress Message-Id: <20211231130427.2239793015906a1c1ede44a4@linux-foundation.org> In-Reply-To: References: <20211202150614.22440-1-mgorman@techsingularity.net> <20211229154553.09dd5bb657bc19d45c3de8dd@linux-foundation.org> <5c9d7c6b-05cd-4d17-b941-a93d90197cd3@leemhuis.info> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 31 Dec 2021 11:21:14 -0800 Linus Torvalds wrote: > On Fri, Dec 31, 2021 at 11:14 AM Linus Torvalds > wrote: > > > > On Fri, Dec 31, 2021 at 6:24 AM Thorsten Leemhuis > > wrote: > > > > > > If we get it into rc8 (which is still possible, even if a bit hard due > > > to the new year festivities), it will get at least one week of testing. > > > > I took it with Hugh's ack from his reply to this, so it should be in rc8. > > Pushed out as 1b4e3f26f9f7 ("mm: vmscan: Reduce throttling due to a > failure to make progress") Needs this fixup, which I shall tweak a bit then send formally in a few minutes. From: Mel Gorman Subject: mm: vmscan: reduce throttling due to a failure to make progress -fix Hugh Dickins reported the following My tmpfs swapping load (tweaked to use huge pages more heavily than in real life) is far from being a realistic load: but it was notably slowed down by your throttling mods in 5.16-rc, and this patch makes it well again - thanks. But: it very quickly hit NULL pointer until I changed that last line to if (first_pgdat) consider_reclaim_throttle(first_pgdat, sc); The likely issue is that huge pages are a major component of the test workload. When this is the case, first_pgdat may never get set if compaction is ready to continue due to this check if (IS_ENABLED(CONFIG_COMPACTION) && sc->order > PAGE_ALLOC_COSTLY_ORDER && compaction_ready(zone, sc)) { sc->compaction_ready = true; continue; } If this was true for every zone in the zonelist, first_pgdat would never get set resulting in a NULL pointer exception. This is a fix to the mmotm patch mm-vmscan-reduce-throttling-due-to-a-failure-to-make-progress.patch Link: https://lkml.kernel.org/r/20211209095453.GM3366@techsingularity.net Signed-off-by: Mel Gorman Reported-by: Hugh Dickins Cc: Michal Hocko Cc: Vlastimil Babka Cc: Rik van Riel Cc: Mike Galbraith Cc: Darrick J. Wong Cc: Shakeel Butt Signed-off-by: Andrew Morton --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/vmscan.c~mm-vmscan-reduce-throttling-due-to-a-failure-to-make-progress-fix +++ a/mm/vmscan.c @@ -3530,7 +3530,8 @@ static void shrink_zones(struct zonelist shrink_node(zone->zone_pgdat, sc); } - consider_reclaim_throttle(first_pgdat, sc); + if (first_pgdat) + consider_reclaim_throttle(first_pgdat, sc); /* * Restore to original mask to avoid the impact on the caller if we _