Re: [PATCH] disable demotion during memory reclamation
From: Johannes Weiner
Date: Tue Sep 09 2025 - 10:46:17 EST
On Tue, Sep 09, 2025 at 09:40:51AM +0200, Michal Hocko wrote:
> On Tue 09-09-25 09:21:41, cuishiwei wrote:
> > When a memory cgroup exceeds its memory limit, the system reclaims
> > its cold memory.However, if /sys/kernel/mm/numa/demotion_enabled is
> > set to 1, memory on fast memory nodes will also be demoted to slow
> > memory nodes.
> >
> > This demotion contradicts the goal of reclaiming cold memory within
> > the memcg.At this point, demoting cold memory from fast to slow nodes
> > is pointless;it doesn't reduce the memcg's memory usage. Therefore,
> > we should set no_demotion when reclaiming memory in a memcg.
>
> We have discussed this in the past and it is my recollection that we
> have concluded that demotion is a part of proper aging and therefore it
> should be done during the limit reclaim.
Yes, thanks. This is intentional. Please see 3f1509c57b1b ("Revert
"mm/vmscan: never demote for memcg reclaim"") for more details.