Skip to contentSkip to conversation

mm: consider CMA pages in watermark check for NUMA balancing target node

PATCH Applied [email protected] 3 participants 3 messages Aug 1, 2024 – Aug 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: consider CMA pages in watermark check for NUMA balancing target node

From: Kaiyang Zhao <[email protected]>

Currently in migrate_balanced_pgdat(), ALLOC_CMA flag is not passed when checking watermark on the migration target node. This does not match the gfp in alloc_misplaced_dst_folio() which allows allocation from CMA.

This causes promotion failures when there are a lot of available CMA memory in the system.

Therefore, we change the alloc_flags passed to zone_watermark_ok() in migrate_balanced_pgdat().

---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/migrate.c +1 -1
index 8578a930cad1..aa482c954cb0 100644
@@ -2526,7 +2526,7 @@ static bool migrate_balanced_pgdat(struct pglist_data *pgdat,
 		if (!zone_watermark_ok(zone, 0,
 				       high_wmark_pages(zone) +
 				       nr_migrate_pages,
-				       ZONE_MOVABLE, 0))
+				       ZONE_MOVABLE, ALLOC_CMA))
 			continue;
 		return true;
 	}
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Thu, Aug 01, 2024 at 06:04:56PM +0000, [email protected] wrote:

From: Kaiyang Zhao <[email protected]>

Currently in migrate_balanced_pgdat(), ALLOC_CMA flag is not passed when checking watermark on the migration target node. This does not match the gfp in alloc_misplaced_dst_folio() which allows allocation from CMA.

Quoted 7 lines

This causes promotion failures when there are a lot of available CMA memory in the system.

Therefore, we change the alloc_flags passed to zone_watermark_ok() in migrate_balanced_pgdat().

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On 2024/8/2 02:04, [email protected] wrote:

From: Kaiyang Zhao <[email protected]>

Currently in migrate_balanced_pgdat(), ALLOC_CMA flag is not passed when checking watermark on the migration target node. This does not match the gfp in alloc_misplaced_dst_folio() which allows allocation from CMA.

Quoted 7 lines

This causes promotion failures when there are a lot of available CMA memory in the system.

Therefore, we change the alloc_flags passed to zone_watermark_ok() in migrate_balanced_pgdat().

LGTM.

Quoted 17 lines
---
  mm/migrate.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/migrate.c +1 -1
index 8578a930cad1..aa482c954cb0 100644
@@ -2526,7 +2526,7 @@ static bool migrate_balanced_pgdat(struct pglist_data *pgdat,
  		if (!zone_watermark_ok(zone, 0,
  				       high_wmark_pages(zone) +
  				       nr_migrate_pages,
-				       ZONE_MOVABLE, 0))
+				       ZONE_MOVABLE, ALLOC_CMA))
  			continue;
  		return true;
  	}