* [PATCH] mm/vmpressure: exclude costly-order reclaim from socket pressure accounting
@ 2026-11-27 12:27 Xueyuan Chen
0 siblings, 0 replies; only message in thread
From: Xueyuan Chen @ 2026-11-27 12:27 UTC (permalink / raw)
To: David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Andrew Morton, Barry Song, JP Kobryn (Meta), Johannes Weiner,
Jakub Kicinski, Rik van Riel
Cc: Shakeel Butt, linux-mm, linux-kernel, Xueyuan Chen
vmpressure() accumulates reclaim statistics but only checks the order
of the last sample when closing a window. As a result, costly-order
reclaim can still trigger socket pressure indirectly or discard
accumulated low-order reclaim statistics.
Skip costly-order reclaim before updating the counters.
Fixes: f2a950170f7a ("mm/vmpressure: skip socket pressure for costly order reclaim")
Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
---
mm/vmpressure.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index 3de99fef3928..9828a67206ef 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -156,6 +156,14 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgroup *memcg, bool tree,
if (!memcg || mem_cgroup_is_root(memcg))
return;
+ /*
+ * Costly-order reclaim relies on compaction, so its efficiency
+ * is a poor signal for socket pressure. Exclude these samples
+ * before they can affect the window.
+ */
+ if (order > PAGE_ALLOC_COSTLY_ORDER)
+ return;
+
spin_lock(&vmpr->sr_lock);
scanned = vmpr->scanned += scanned;
reclaimed = vmpr->reclaimed += reclaimed;
@@ -168,15 +176,7 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgroup *memcg, bool tree,
level = vmpressure_calc_level(scanned, reclaimed);
- /*
- * Once we go above COSTLY_ORDER, reclaim relies heavily on
- * compaction to make progress. Reclaim efficiency was never a
- * great proxy for pressure to begin with, but it's outright
- * misleading with these high orders. Don't throttle sockets
- * because somebody is attempting something crazy like an order-7
- * and predictably struggling.
- */
- if (level > VMPRESSURE_LOW && order <= PAGE_ALLOC_COSTLY_ORDER) {
+ if (level > VMPRESSURE_LOW) {
/*
* Let the socket buffer allocator know that
* we are having trouble reclaiming LRU pages.
---
base-commit: b95f8bb86713c860ce8536d22a988b949b884d5f
--
Best regards,
Xueyuan
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-27 12:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 12:27 [PATCH] mm/vmpressure: exclude costly-order reclaim from socket pressure accounting Xueyuan Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox