From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outbound-smtp08.blacknight.com (outbound-smtp08.blacknight.com [46.22.139.13]) (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 C6A142C9C for ; Thu, 9 Dec 2021 09:55:02 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id 6426D1C3B7B for ; Thu, 9 Dec 2021 09:54:55 +0000 (GMT) Received: (qmail 28472 invoked from network); 9 Dec 2021 09:54:55 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.197.169]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 9 Dec 2021 09:54:55 -0000 Date: Thu, 9 Dec 2021 09:54:53 +0000 From: Mel Gorman To: Andrew Morton Cc: Hugh Dickins , Michal Hocko , Vlastimil Babka , Alexey Avramov , Rik van Riel , Mike Galbraith , Darrick Wong , Shakeel Butt , regressions@lists.linux.dev, Linux-fsdevel , Linux-MM , LKML Subject: [PATCH] mm: vmscan: reduce throttling due to a failure to make progress -fix Message-ID: <20211209095453.GM3366@techsingularity.net> Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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 Reported-by: Hugh Dickins Signed-off-by: Mel Gorman --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 4c4d5f6cd8a3..700434db5735 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3530,7 +3530,8 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc) 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