[RFC PATCH 0/2] Prevent demotions in memcg limit reclaim when toptier has room

From: Joshua Hahn

Date: Mon Nov 30 2026 - 16:53:05 EST


On tiered systems, cgroups above their memory limit can still demote and
count it towards reclaim progress, despite not shrinking the cgroup's
memory usage. This is so that limit reclaim participates in the
cross-tier aging pipeline, as explained in
3f1509c57b1b (Revert "mm/vmscan: never demote for memcg reclaim").

The revert notes that in the undercommit case where the sum of cgroup
limits <= toptier memory, "shuffling pages out to lower tiers first to
reclaim them from there is inefficient".

In Meta production, we have seen this on undercommitted hosts and hosts
where memcg limits add up to more than DRAM, but bursty usage keeps host
memory well below DRAM capacity for long periods. Caching workloads on
these hosts saw pgdemote_direct taking up about 80% of pgsteal_direct,
so only 1 in 5 reclaimed pages actually lowered the memcg's usage.
NUMA balancing kept promoting the hot demoted pages back, and this led
the CXL bandwidth to be completely saturated.

When there is free space in DRAM, prevent demotions from cgroup limit
reclaim. The cross-node LRU aging pipeline is still kept moving forward
through proactive reclaim, kswapd, and direct reclaim when the system is
also pressured.

Running the same caching workload mentioned above on a pool of 50 hosts,
throughput increased by about 27%.

Joshua Hahn (2):
mm/memory-tiers: move pgdat_free_space_enough() out of the scheduler
mm/vmscan: don't demote in memcg limit reclaim while the node has room

include/linux/memory-tiers.h | 11 +++++++++++
kernel/sched/fair.c | 28 ----------------------------
mm/memory-tiers.c | 31 +++++++++++++++++++++++++++++++
mm/vmscan.c | 5 +++++
4 files changed, 47 insertions(+), 28 deletions(-)


base-commit: 9f004372ebeb18fdeb699f9880a0e472df90135b
--
2.53.1-Meta