Re: [PATCH 2/3] mm/memcontrol: disable demotion in memcg direct reclaim

From: Bing Jiao

Date: Wed Mar 18 2026 - 17:00:14 EST


On Tue, Mar 17, 2026 at 04:44:34PM -0700, Yosry Ahmed wrote:
> On Tue, Mar 17, 2026 at 4:07 PM Bing Jiao <bingjiao@xxxxxxxxxx> wrote:
> >
> > NUMA demotion counts towards reclaim targets in shrink_folio_list(), but
> > it does not reduce the total memory usage of a memcg. In memcg direct
> > reclaim paths (e.g., charge-triggered or manual limit writes), where
> > demotion is allowed, this leads to "fake progress" where the reclaim
> > loop concludes it has satisfied the memory request without actually
> > reducing the cgroup's charge.
> >
> > This could result in inefficient reclaim loops, CPU waste, moving all
> > pages to far-tier nodes, and potentially premature OOM kills when the
> > cgroup is under memory pressure but demotion is still possible.
> >
> > Introduce the MEMCG_RECLAIM_NO_DEMOTION flag to disable demotion in
> > these memcg-specific reclaim paths. This ensures that reclaim
> > progress is only counted when memory is actually freed or swapped out.
>
> See the discussion @
> https://lore.kernel.org/linux-mm/20250909012141.1467-1-cuishw@xxxxxxxxxx/
> and the commits/threads it is referring to.

Hi Yosry,

Thanks for pointing it out! I was unaware of the previous discussion
regarding demotion as aging progress.

I will drop patches 2 and 3 from this series and resubmit patch 1 as
a standalone fix by replying to this thread.

Thanks,
Bing