From: "T.J. Mercier" <tjmercier@google.com>
To: hailong <hailong.liu@oppo.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, yuzhao@google.com,
21cnbao@gmail.com
Subject: Re: [RFC PATCH] mm/mglru: keep the root_memcg reclaim behavior the same as memcg reclaim
Date: Thu, 12 Dec 2024 10:22:31 -0800 [thread overview]
Message-ID: <CABdmKX2__wuSLH2x=5=SqQR0wo86R-Xknua-q9BC44XQDjwgug@mail.gmail.com> (raw)
In-Reply-To: <20241212095646.16164-1-hailong.liu@oppo.com>
On Thu, Dec 12, 2024 at 1:57 AM hailong <hailong.liu@oppo.com> wrote:
>
> From: Hailong Liu <hailong.liu@oppo.com>
>
> commit a579086c99ed ("mm: multi-gen LRU: remove eviction fairness safeguard") said
> Note that memcg LRU only applies to global reclaim. For memcg reclaim,
> the eviction will continue, even if it is overshooting. This becomes
> unconditional due to code simplification.
>
> Howeven, if we reclaim a root memcg by sysfs (memory.reclaim), the behavior acts
> as a kswapd or direct reclaim.
Hi Hailong,
Why do you think this is a problem?
> Fix this by remove the condition of mem_cgroup_is_root in
> root_reclaim().
> Signed-off-by: Hailong Liu <hailong.liu@oppo.com>
> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 76378bc257e3..1f74f3ba0999 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -216,7 +216,7 @@ static bool cgroup_reclaim(struct scan_control *sc)
> */
> static bool root_reclaim(struct scan_control *sc)
> {
> - return !sc->target_mem_cgroup || mem_cgroup_is_root(sc->target_mem_cgroup);
> + return !sc->target_mem_cgroup;
> }
>
> /**
> --
> Actually we switch to mglru on kernel-6.1 and see different behavior on
> root_mem_cgroup reclaim. so is there any background fot this?
Reclaim behavior differs with MGLRU.
https://lore.kernel.org/lkml/20221201223923.873696-1-yuzhao@google.com/
On even more recent kernels, regular LRU reclaim has also changed.
https://lore.kernel.org/lkml/20240514202641.2821494-1-hannes@cmpxchg.org/
> Brs,
> Hailong.
>
next prev parent reply other threads:[~2024-12-12 18:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 9:56 hailong
2024-12-12 18:22 ` T.J. Mercier [this message]
2024-12-13 2:26 ` hailong
2024-12-13 17:06 ` T.J. Mercier
2024-12-16 1:54 ` hailong
2024-12-16 17:13 ` T.J. Mercier
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='CABdmKX2__wuSLH2x=5=SqQR0wo86R-Xknua-q9BC44XQDjwgug@mail.gmail.com' \
--to=tjmercier@google.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hailong.liu@oppo.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