From: Wei Xu <weixugc@google.com>
To: Yu Zhao <yuzhao@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Axel Rasmussen <axelrasmussen@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/mglru: only clear kswapd_failures if reclaimable
Date: Tue, 15 Oct 2024 22:29:11 -0700 [thread overview]
Message-ID: <CAAPL-u8M4-i=76prAuRws1_Jvp3+fkYY3gHDgEpZ7VP45KY39Q@mail.gmail.com> (raw)
In-Reply-To: <CAOUHufZcmS-RCBf7dY5C5HYXp16GZC0WiaNPugfgTA0XXjMVgQ@mail.gmail.com>
On Tue, Oct 15, 2024 at 9:57 PM Yu Zhao <yuzhao@google.com> wrote:
>
> On Mon, Oct 14, 2024 at 4:12 PM Wei Xu <weixugc@google.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@google.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.
>
"goto done" is still used at the beginning of lru_gen_shrink_node().
We can refactor the code to remove it. But it is better to be handled
in a separate change.
> > - /* kswapd should never fail */
> > - pgdat->kswapd_failures = 0;
> > + if (sc->nr_reclaimed > reclaimed)
> > + pgdat->kswapd_failures = 0;
> > }
> >
> > /******************************************************************************
> > --
> > 2.47.0.rc1.288.g06298d1525-goog
> >
> >
prev parent reply other threads:[~2024-10-16 5:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 22:12 Wei Xu
2024-10-14 23:25 ` Andrew Morton
2024-10-14 23:41 ` Wei Xu
2024-10-16 4:56 ` Yu Zhao
2024-10-16 5:29 ` Wei Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAPL-u8M4-i=76prAuRws1_Jvp3+fkYY3gHDgEpZ7VP45KY39Q@mail.gmail.com' \
--to=weixugc@google.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yuzhao@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox