linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] disable demotion during memory reclamation
@ 2025-09-09  1:21 cuishiwei
  2025-09-09  1:36 ` Andrew Morton
  2025-09-09  7:40 ` Michal Hocko
  0 siblings, 2 replies; 6+ messages in thread
From: cuishiwei @ 2025-09-09  1:21 UTC (permalink / raw)
  To: akpm, axelrasmussen, yuanchu, hannes
  Cc: weixugc, david, zhengqi.arch, shakeel.butt, lorenzo.stoakes,
	linux-mm, linux-kernel, cuishiwei

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.

Signed-off-by: cuishiwei <cuishw@inspur.com>
---
 mm/vmscan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index ca9e1cd3cd68..1edf618a3604 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6706,6 +6706,7 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg,
 		.may_unmap = 1,
 		.may_swap = !!(reclaim_options & MEMCG_RECLAIM_MAY_SWAP),
 		.proactive = !!(reclaim_options & MEMCG_RECLAIM_PROACTIVE),
+		.no_demotion = 1,
 	};
 	/*
 	 * Traverse the ZONELIST_FALLBACK zonelist of the current node to put
-- 
2.43.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-10  6:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-09  1:21 [PATCH] disable demotion during memory reclamation cuishiwei
2025-09-09  1:36 ` Andrew Morton
2025-09-09  2:40   ` cuishiwei
2025-09-09  7:40 ` Michal Hocko
2025-09-09 14:45   ` Johannes Weiner
2025-09-10  6:36     ` cuishiwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox