linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <baohua@kernel.org>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Michal Hocko <mhocko@kernel.org>,
	"T . J . Mercier" <tjmercier@google.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	steve.kang@unisoc.com
Subject: Re: [PATCHv3] mm: remove '!root_reclaim' checking in should_abort_scan()
Date: Tue, 7 Apr 2026 11:45:42 +0800	[thread overview]
Message-ID: <CAGsJ_4zkiDCjPnRJ4LbFakpX3LiL-F6X_BSju3iHS-d5iugVSg@mail.gmail.com> (raw)
In-Reply-To: <CAGWkznHc56x8REsLPJsnK2t8ZHwu3CK8fTd-Gb=sBW3X+EXD8Q@mail.gmail.com>

On Fri, Apr 3, 2026 at 3:05 PM Zhaoyang Huang <huangzhaoyang@gmail.com> wrote:
>
> On Fri, Apr 3, 2026 at 6:59 AM Barry Song <baohua@kernel.org> wrote:
> >
> > On Wed, Mar 18, 2026 at 9:18 AM zhaoyang.huang
> > <zhaoyang.huang@unisoc.com> wrote:
> > >
> > > From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> > >
> > > Android systems usually use memory.reclaim interface to implement user
> > > space memory management which expects that the requested reclaim target
> > > and actually reclaimed amount memory are not diverging by too much. With
> > > the current MGRLU implementation there is, however, no bail out when the
> > > reclaim target is reached and this could lead to an excessive reclaim
> > > that scales with the reclaim hierarchy size.For example, we can get a
> > > nr_reclaimed=394/nr_to_reclaim=32 proactive reclaim under a common 1-N
> > > cgroup hierarchy.
> > > This defect arised from the goal of keeping fairness among memcgs that
> > > is, for try_to_free_mem_cgroup_pages -> shrink_node_memcgs ->
> > > shrink_lruvec -> lru_gen_shrink_lruvec -> try_to_shrink_lruvec, the
> > > !root_reclaim(sc) check was there for reclaim fairness, which was
> > > necessary before commit 'b82b530740b9' ("mm: vmscan: restore
> > > incremental cgroup iteration") because the fairness depended on
> > > attempted proportional reclaim from every memcg under the target
> > > memcg. However after commit 'b82b530740b9' there is no longer a need
> > > to visit every memcg to ensure fairness. Let's have try_to_shrink_lruvec
> > > bail out when the nr_reclaimed achieved.
> >
> > I think we need some clarification here. Does the code
> >
> > nr_to_scan = apply_proportional_protection(memcg, sc, nr_to_scan);
> >
> > still serve a purpose, or has it become less useful after your patch?
> proportional protection is still useful for calculating the nr_to_scan
> when 'memory.min/low' is configured in the hierarchy.
>

Right, thanks! Also, the patch looks sensible to me,

Reviewed-by: Barry Song <baohua@kernel.org>


  reply	other threads:[~2026-04-07  3:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18  1:15 zhaoyang.huang
2026-03-18  8:31 ` Michal Hocko
2026-04-02  3:02 ` Shakeel Butt
2026-04-02  3:36 ` Qi Zheng
2026-04-02 22:59 ` Barry Song
2026-04-03  7:05   ` Zhaoyang Huang
2026-04-07  3:45     ` Barry Song [this message]
2026-04-07 14:26 ` Kairui Song
2026-04-08  1:42   ` Zhaoyang Huang

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=CAGsJ_4zkiDCjPnRJ4LbFakpX3LiL-F6X_BSju3iHS-d5iugVSg@mail.gmail.com \
    --to=baohua@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=steve.kang@unisoc.com \
    --cc=tjmercier@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