* [PATCH] mm: remove '!root_reclaim' checking in should_abort_scan()
@ 2026-02-12 3:21 zhaoyang.huang
2026-02-12 22:57 ` T.J. Mercier
0 siblings, 1 reply; 2+ messages in thread
From: zhaoyang.huang @ 2026-02-12 3:21 UTC (permalink / raw)
To: Andrew Morton, Yu Zhao, Michal Hocko, Rik van Riel, Shakeel Butt,
Roman Gushchin, Johannes Weiner, T . J . Mercier, linux-mm,
linux-kernel, Zhaoyang Huang, steve.kang
From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Nowadays, ANDROID system replaces madivse with memory.reclaim to implement
user space memory management which desires to reclaim a certain amount of
memcg's memory. However, oversized reclaiming and high latency are observed
as there is no limitation over nr_reclaimed inside try_to_shrink_lruvec
when MGLRU enabled. Besides, this could also affect all none root_reclaim
such as reclaim_high etc.
Since the commit 'b82b530740b9' ("mm: vmscan: restore incremental cgroup
iteration") introduces sc->memcg_full_walk to limit the walk range of
mem_cgroup_iter and keep the fairness among the descendants of one memcg.
This commit would like to make single memcg's scanning more precised by
removing the criteria of 'if (!root_reclaim)' inside
should_abort_scan().
Suggested-by: T.J.Mercier <tjmercier@google.com>
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
mm/vmscan.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 670fe9fae5ba..9d900be478ea 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4832,10 +4832,6 @@ 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))
- return false;
-
if (sc->nr_reclaimed >= max(sc->nr_to_reclaim, compact_gap(sc->order)))
return true;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: remove '!root_reclaim' checking in should_abort_scan()
2026-02-12 3:21 [PATCH] mm: remove '!root_reclaim' checking in should_abort_scan() zhaoyang.huang
@ 2026-02-12 22:57 ` T.J. Mercier
0 siblings, 0 replies; 2+ messages in thread
From: T.J. Mercier @ 2026-02-12 22:57 UTC (permalink / raw)
To: zhaoyang.huang
Cc: Andrew Morton, Yu Zhao, Michal Hocko, Rik van Riel, Shakeel Butt,
Roman Gushchin, Johannes Weiner, linux-mm, linux-kernel,
Zhaoyang Huang, steve.kang
On Wed, Feb 11, 2026 at 7:22 PM zhaoyang.huang
<zhaoyang.huang@unisoc.com> wrote:
>
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>
> Nowadays, ANDROID system replaces madivse with memory.reclaim to implement
> user space memory management which desires to reclaim a certain amount of
> memcg's memory. However, oversized reclaiming and high latency are observed
> as there is no limitation over nr_reclaimed inside try_to_shrink_lruvec
> when MGLRU enabled. Besides, this could also affect all none root_reclaim
> such as reclaim_high etc.
> Since the commit 'b82b530740b9' ("mm: vmscan: restore incremental cgroup
> iteration") introduces sc->memcg_full_walk to limit the walk range of
> mem_cgroup_iter and keep the fairness among the descendants of one memcg.
> This commit would like to make single memcg's scanning more precised by
> removing the criteria of 'if (!root_reclaim)' inside
> should_abort_scan().
>
> Suggested-by: T.J.Mercier <tjmercier@google.com>
> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-12 22:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-12 3:21 [PATCH] mm: remove '!root_reclaim' checking in should_abort_scan() zhaoyang.huang
2026-02-12 22:57 ` T.J. Mercier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox