mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Qi Zheng <qi.zheng@linux.dev>,
	David Hildenbrand <david@kernel.org>,
	Gregory Price <gourry@gourry.net>, Zi Yan <ziy@nvidia.com>,
	Rakie Kim <rakie.kim@sk.com>,
	Ying Huang <ying.huang@linux.alibaba.com>,
	Kairui Song <kasong@tencent.com>, Barry Song <baohua@kernel.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	Baoquan He <baoquan.he@linux.dev>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: [RFC PATCH 0/2] Prevent demotions in memcg limit reclaim when toptier has room
Date: Mon, 30 Nov 2026 13:52:55 -0800	[thread overview]
Message-ID: <20261130215258.2202513-1-joshua.hahnjy@gmail.com> (raw)

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


             reply	other threads:[~2026-11-30 21:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 21:52 Joshua Hahn [this message]
2026-11-30 21:52 ` [RFC PATCH 1/2] mm/memory-tiers: move pgdat_free_space_enough() out of the scheduler Joshua Hahn
2026-11-30 21:52 ` [RFC PATCH 2/2] mm/vmscan: don't demote in memcg limit reclaim while the node has room Joshua Hahn

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=20261130215258.2202513-1-joshua.hahnjy@gmail.com \
    --to=joshua.hahnjy@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baoquan.he@linux.dev \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=gourry@gourry.net \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=qi.zheng@linux.dev \
    --cc=rakie.kim@sk.com \
    --cc=shakeel.butt@linux.dev \
    --cc=weixugc@google.com \
    --cc=ying.huang@linux.alibaba.com \
    --cc=yuanchu@google.com \
    --cc=ziy@nvidia.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

all inboxes | Powered by JetHome®