linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hyeongtak Ji <hyeongtak.ji@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org, Hyeongtak Ji <hyeongtak.ji@sk.com>
Subject: Re: [PATCH] mm/vmscan: consider previously reclaimed pages in shrink_lruvec()
Date: Wed, 8 Nov 2023 19:25:20 +0900	[thread overview]
Message-ID: <CAFY0u4Q3oo6SUt1nmVaoHDT0OL=pB0OjmRUiXAFw-jdjdWqsBQ@mail.gmail.com> (raw)
In-Reply-To: <20231107183346.GA3789583@cmpxchg.org>

Hello,

Thank you for your reply.

On Wed, Nov 8, 2023 at 3:33 AM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> On Mon, Aug 07, 2023 at 07:01:16PM +0900, Hyeongtak Ji wrote:
> > shrink_lruvec() currently ignores previously reclaimed pages in
> > scan_control->nr_reclaimed.  This can lead shrink_lruvec() to reclaiming
> > more pages than expected.
> >
> > This patch fixes shrink_lruvec() to take into account the previously
> > reclaimed pages.
>
> Do you run into real world issues from this? The code has been like
> this for at least a decade.
>

I believed this was merely a misinitialization that resulted in
shrink_lruvec() reclaiming more pages than intended. However, I do
acknowledge that there have not been any real world issues arising from
this behavior.

> It's an intentional choice to ensure fairness across all visited
> cgroups. sc->nr_to_reclaim is 32 pages or less - it's only to guard

sc->nr_to_reclaim can be larger than 32 (e.g., about 5K) in the case that I
was worrying about. kswapd_shrink_node() in mm/vmscan.c sets the value
and it is passed down to shrink_lruvec().

> against extreme overreclaim. But we want to make sure we reclaim a bit
> from all cgroups, rather than always hit the first one and then bail.


      reply	other threads:[~2023-11-08 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 10:01 Hyeongtak Ji
2023-11-07 18:33 ` Johannes Weiner
2023-11-08 10:25   ` Hyeongtak Ji [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='CAFY0u4Q3oo6SUt1nmVaoHDT0OL=pB0OjmRUiXAFw-jdjdWqsBQ@mail.gmail.com' \
    --to=hyeongtak.ji@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hyeongtak.ji@sk.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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