linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Byungchul Park <byungchul@sk.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org, kernel_team@skhynix.com
Subject: Re: [PATCH] mm, vmscan: Don't turn on cache_trim_mode at the highest scan priority
Date: Fri, 16 Feb 2024 00:55:17 -0500	[thread overview]
Message-ID: <CAOUHufYUC-oWePfqbbmm15Ue9QLfPg1G2nhXn6iSX_A460O6Uw@mail.gmail.com> (raw)
In-Reply-To: <20240208061825.36640-1-byungchul@sk.com>

On Thu, Feb 8, 2024 at 1:18 AM Byungchul Park <byungchul@sk.com> wrote:
>
> With cache_trim_mode on, reclaim logic doesn't bother reclaiming anon
> pages. However, it should be more careful to turn on the mode because
> it's going to prevent anon pages from reclaimed even if there are huge
> ammount of anon pages that are very cold so should be reclaimed. Even
> worse, that can lead kswapd_failures to be MAX_RECLAIM_RETRIES and stop
> until direct reclaim eventually works to resume kswapd.

Is a theory or something observed in the real world? If it's the
former, would this change risk breaking existing use cases? It's the
latter, where are the performance numbers to show what it looks like
before and after this patch?

> Signed-off-by: Byungchul Park <byungchul@sk.com>
> ---
>  mm/vmscan.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index bba207f41b14..25b55fdc0d41 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2268,7 +2268,8 @@ static void prepare_scan_control(pg_data_t *pgdat, struct scan_control *sc)
>          * anonymous pages.
>          */
>         file = lruvec_page_state(target_lruvec, NR_INACTIVE_FILE);
> -       if (file >> sc->priority && !(sc->may_deactivate & DEACTIVATE_FILE))
> +       if (sc->priority != 1 && file >> sc->priority &

Why 1?

> +           !(sc->may_deactivate & DEACTIVATE_FILE))
>                 sc->cache_trim_mode = 1;
>         else
>                 sc->cache_trim_mode = 0;


  reply	other threads:[~2024-02-16  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  6:18 Byungchul Park
2024-02-16  5:55 ` Yu Zhao [this message]
2024-02-16  7:24   ` Byungchul Park
2024-02-17  5:11     ` Yu Zhao
2024-02-21 22:30       ` Andrew Morton
2024-02-22  3:27         ` Byungchul Park

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=CAOUHufYUC-oWePfqbbmm15Ue9QLfPg1G2nhXn6iSX_A460O6Uw@mail.gmail.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=byungchul@sk.com \
    --cc=kernel_team@skhynix.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