From: gaoxu <gaoxu2@honor.com>
To: Yu Zhao <yuzhao@google.com>, Kalesh Singh <kaleshsingh@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Suren Baghdasaryan <surenb@google.com>, Shaohua Li <shli@fb.com>,
yipengxiang <yipengxiang@honor.com>,
fengbaopeng <fengbaopeng@honor.com>
Subject: 回复: [PATCH] mm: add lazyfree folio to lru tail
Date: Fri, 16 Aug 2024 01:41:43 +0000 [thread overview]
Message-ID: <86738d19f97843efbfa0f83a2d85115a@honor.com> (raw)
In-Reply-To: <CAOUHufZzmUU6YxOfQ7-v6AMj29uoMOLKMz0RWk9MRA4DkDSXAQ@mail.gmail.com>
>
> On Thu, Aug 15, 2024 at 6:33 AM gaoxu <gaoxu2@honor.com> wrote:
> >
> > Replace lruvec_add_folio with lruvec_add_folio_tail in the lru_lazyfree_fn:
> > 1. The lazy-free folio is added to the LRU_INACTIVE_FILE list. If it's
> > moved to the LRU tail, it allows for faster release lazy-free folio and
> > reduces the impact on file refault.
> > 2. When mglru is enabled, the lazy-free folio is reclaimabled and should be
> > added using lru_gen_add_folio(lruvec, folio, true) instead of
> > lru_gen_add_folio(lruvec, folio, false) for adding to gen.
> >
> > With the change in place, workingset_refault_file is reduced by 33% in the
> > continuous startup testing of the applications in the Android system.
> >
> > Signed-off-by: gao xu <gaoxu2@hihonor.com>
> > ---
> > mm/swap.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/swap.c b/mm/swap.c
> > index 67786cb77..ed49643ec 100644
> > --- a/mm/swap.c
> > +++ b/mm/swap.c
> > @@ -635,7 +635,7 @@ static void lru_lazyfree_fn(struct lruvec *lruvec, struct
> folio *folio)
>
> Please work against the latest mm-unstable.
This was my mistake. Thank you for the reminder.
I will resend the patch based on the mm-unstable branch
>
> > * anonymous folios
> > */
> > folio_clear_swapbacked(folio);
> > - lruvec_add_folio(lruvec, folio);
> > + lruvec_add_folio_tail(lruvec, folio);
> >
> > __count_vm_events(PGLAZYFREE, nr_pages);
> > __count_memcg_events(lruvec_memcg(lruvec),
> PGLAZYFREE,
>
> Kalesh has been working on something similar for lru_deactivate(), and
> he can help test and review this patch.
prev parent reply other threads:[~2024-08-16 1:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 12:33 gaoxu
2024-08-15 18:10 ` Yu Zhao
2024-08-16 1:41 ` gaoxu [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=86738d19f97843efbfa0f83a2d85115a@honor.com \
--to=gaoxu2@honor.com \
--cc=akpm@linux-foundation.org \
--cc=fengbaopeng@honor.com \
--cc=kaleshsingh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shli@fb.com \
--cc=surenb@google.com \
--cc=yipengxiang@honor.com \
--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