linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Yu Zhao <yuzhao@google.com>,  Michal Hocko <mhocko@kernel.org>,
	Rik van Riel <riel@surriel.com>,
	 Shakeel Butt <shakeel.butt@linux.dev>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 steve.kang@unisoc.com
Subject: Re: [PATCH] mm: bail out from partial cgroup_reclaim inside shrink_lruvec
Date: Mon, 9 Feb 2026 15:36:17 +0800	[thread overview]
Message-ID: <CAGWkznGom7mCk=6dHT6EDouexo2YLFiYpzeTcS4Nexuww4__dA@mail.gmail.com> (raw)
In-Reply-To: <20260205064528.32794-1-zhaoyang.huang@unisoc.com>

On Thu, Feb 5, 2026 at 2:47 PM zhaoyang.huang <zhaoyang.huang@unisoc.com> wrote:
>
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>
> Oversize reclaiming observed in "echo xxx > memory.reclaim". This commit
> would like to sync the stop criteria in shrink_node_memcgs to
> shrink_lruvec to have partial cgroup_reclaim bail out as early as it can
> be.
>
> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> ---
>  mm/vmscan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 670fe9fae5ba..03bda1094621 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4832,8 +4832,8 @@ static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc)
>         int i;
>         enum zone_watermarks mark;
>
> -       /* don't abort memcg reclaim to ensure fairness */
> -       if (!root_reclaim(sc))
> +       /* don't abort full walk memcg reclaim to ensure fairness */
> +       if (!root_reclaim(sc) && sc->memcg_full_walk)
>                 return false;
>
>         if (sc->nr_reclaimed >= max(sc->nr_to_reclaim, compact_gap(sc->order)))
> --
Talk more about motivation. Nowadays, android systems replace madivse
with memory.reclaim to implement user space memory management which
desires to reclaim a certain amount of memcg's memory. However,
oversized reclaiming is observed as there is no limitation within
try_to_shrink_lruvec when MGLRU enabled. This commit would like to fix
this by judging sc->memcg_full_walk.

> 2.25.1
>


      reply	other threads:[~2026-02-09  7:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  6:45 zhaoyang.huang
2026-02-09  7:36 ` Zhaoyang Huang [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='CAGWkznGom7mCk=6dHT6EDouexo2YLFiYpzeTcS4Nexuww4__dA@mail.gmail.com' \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=riel@surriel.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=steve.kang@unisoc.com \
    --cc=yuzhao@google.com \
    --cc=zhaoyang.huang@unisoc.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