diff mbox series

[RFC,2/7] Disallows high-order movable allocations in other zones if ZONE_MOVABLE is populated

Message ID 20240320024218.203491-3-kaiyang2@cs.cmu.edu (mailing list archive)
State New
Headers show
Series mm: providing ample physical memory contiguity by confining unmovable allocations | expand

Commit Message

kaiyang2@cs.cmu.edu March 20, 2024, 2:42 a.m. UTC
From: Kaiyang Zhao <kaiyang2@cs.cmu.edu>

Use ZONE_MOVABLE exclusively for non-0 order allocations

Signed-off-by: Kaiyang Zhao <zh_kaiyang@hotmail.com>
---
 mm/page_alloc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 47421bedc12b..9ad9357e340a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3403,6 +3403,16 @@  get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
 		struct page *page;
 		unsigned long mark;
 
+		/*
+		 * Disallows high-order movable allocations in other zones if
+		 * ZONE_MOVABLE is populated on this node.
+		 */
+		if (ac->highest_zoneidx >= ZONE_MOVABLE &&
+			order > 0 &&
+			zone_idx(zone) != ZONE_MOVABLE &&
+			populated_zone(&(zone->zone_pgdat->node_zones[ZONE_MOVABLE])))
+				continue;
+
 		if (cpusets_enabled() &&
 			(alloc_flags & ALLOC_CPUSET) &&
 			!__cpuset_zone_allowed(zone, gfp_mask))