[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOUHufZcmS-RCBf7dY5C5HYXp16GZC0WiaNPugfgTA0XXjMVgQ@mail.gmail.com>
Date: Tue, 15 Oct 2024 22:56:56 -0600
From: Yu Zhao <yuzhao@...gle.com>
To: Wei Xu <weixugc@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Axel Rasmussen <axelrasmussen@...gle.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/mglru: only clear kswapd_failures if reclaimable
On Mon, Oct 14, 2024 at 4:12 PM Wei Xu <weixugc@...gle.com> 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().
>
> Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists")
> Signed-off-by: Wei Xu <weixugc@...gle.com>
> ---
> mm/vmscan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 50dc06d55b1d..9d1e1c4e383d 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4970,8 +4970,8 @@ static void lru_gen_shrink_node(struct pglist_data *pgdat, struct scan_control *
>
> blk_finish_plug(&plug);
> done:
Nit: the "done:" isn't used anymore, so better just remove it.
> - /* kswapd should never fail */
> - pgdat->kswapd_failures = 0;
> + if (sc->nr_reclaimed > reclaimed)
> + pgdat->kswapd_failures = 0;
> }
>
> /******************************************************************************
> --
> 2.47.0.rc1.288.g06298d1525-goog
>
>
Powered by blists - more mailing lists