From: Kairui Song <ryncsn@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Yu Zhao <yuzhao@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Michal Hocko <mhocko@suse.com>, Hugh Dickins <hughd@google.com>,
Nhat Pham <nphamcs@gmail.com>, Yuanchu Xie <yuanchu@google.com>,
Suren Baghdasaryan <surenb@google.com>,
"T . J . Mercier" <tjmercier@google.com>
Subject: Re: [RFC PATCH v2 1/5] workingset: simplify and use a more intuitive model
Date: Wed, 13 Sep 2023 17:26:02 +0800 [thread overview]
Message-ID: <CAMgjq7B_2WY_0Zz71YCLnZ7uVwfWCMdLeO5dF_Rqw7a5gR8mzQ@mail.gmail.com> (raw)
In-Reply-To: <20230912194728.GA36054@cmpxchg.org>
Johannes Weiner <hannes@cmpxchg.org> 于2023年9月13日周三 03:47写道:
>
> Hello Kairui,
>
> On Wed, Sep 13, 2023 at 02:45:07AM +0800, Kairui Song wrote:
> > @@ -226,8 +227,103 @@ static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
> > *workingsetp = workingset;
> > }
> >
> > -#ifdef CONFIG_LRU_GEN
> > +/*
> > + * Get the distance reading at eviction time.
> > + */
> > +static inline unsigned long lru_eviction(struct lruvec *lruvec,
> > + int bits, int bucket_order)
> > +{
> > + unsigned long eviction = atomic_long_read(&lruvec->nonresident_age);
> > +
> > + eviction >>= bucket_order;
> > + eviction &= ~0UL >> (BITS_PER_LONG - bits);
> > +
> > + return eviction;
> > +}
> > +
> > +/*
> > + * Calculate and test refault distance
> > + */
> > +static inline bool lru_refault(struct mem_cgroup *memcg,
> > + struct lruvec *lruvec,
> > + unsigned long eviction, bool file,
> > + int bits, int bucket_order)
> > +{
>
> This patch changes the refault decision making at the same time as it
> moves the functions around in preparation for use by MGLRU. This makes
> it difficult to review the exact changes to the current algorithm.
>
> Can you please separate those two components?
Hi, thanks for the review.
>
> Step 1: Change the existing logic in its place to the new
> algorithm. Please also update the big comment on how everything works
> at the same time (IOW, merge patch #2 into this one).
>
> Step 2: Add a new patch to refactor for MGLRU right before the patch
> that will use those functions. As far as I can see, that's the last
> patch in the series. So the refactor should be second-to-last.
>
Good suggestion, I'll split these parts into individual patches and
merge the comments.
> Thanks
next prev parent reply other threads:[~2023-09-13 9:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 18:45 [RFC PATCH v2 0/5] Refault distance checking for MGLRU Kairui Song
2023-09-12 18:45 ` [RFC PATCH v2 1/5] workingset: simplify and use a more intuitive model Kairui Song
2023-09-12 19:47 ` Johannes Weiner
2023-09-13 9:26 ` Kairui Song [this message]
2023-09-12 18:45 ` [RFC PATCH v2 2/5] workingset: update comment in workingset.c Kairui Song
2023-09-12 18:45 ` [RFC PATCH v2 3/5] workingset: simplify lru_gen_test_recent Kairui Song
2023-09-12 18:45 ` [RFC PATCH v2 4/5] lru_gen: convert avg_total and avg_refaulted to atomic Kairui Song
2023-09-12 18:45 ` [RFC PATCH v2 5/5] workingset, lru_gen: apply refault-distance based re-activation Kairui Song
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=CAMgjq7B_2WY_0Zz71YCLnZ7uVwfWCMdLeO5dF_Rqw7a5gR8mzQ@mail.gmail.com \
--to=ryncsn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=nphamcs@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=surenb@google.com \
--cc=tjmercier@google.com \
--cc=yuanchu@google.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