Re: [PATCH 1/2] mm/mglru: only clear kswapd_failures if reclaimable

From: Andrew Morton
Date: Mon Oct 14 2024 - 19:25:47 EST


On Mon, 14 Oct 2024 22:12:11 +0000 Wei Xu <weixugc@xxxxxxxxxx> wrote:

> lru_gen_shrink_node() unconditionally clears kswapd_failures, which
> can prevent kswapd from sleeping and cause 100% kswapd cpu usage even
> when kswapd repeatedly fails to make progress in reclaim.
>
> Only clear kswap_failures in lru_gen_shrink_node() if reclaim makes
> some progress, similar to shrink_node().

That sounds bad. What triggers this? Can you suggest why it has just
bee discovered, after 1.5 years? And should the fix be backported into
-stable kernels?