linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node
@ 2024-08-01 18:04 kaiyang2
  2024-08-01 19:04 ` Johannes Weiner
  2024-08-02  2:40 ` Baolin Wang
  0 siblings, 2 replies; 3+ messages in thread
From: kaiyang2 @ 2024-08-01 18:04 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, hannes, Kaiyang Zhao

From: Kaiyang Zhao <kaiyang2@cs.cmu.edu>

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().

Signed-off-by: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 8578a930cad1..aa482c954cb0 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -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;
 	}
-- 
2.43.0



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

* Re: [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node
  2024-08-01 18:04 [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node kaiyang2
@ 2024-08-01 19:04 ` Johannes Weiner
  2024-08-02  2:40 ` Baolin Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Weiner @ 2024-08-01 19:04 UTC (permalink / raw)
  To: kaiyang2; +Cc: linux-mm, akpm

On Thu, Aug 01, 2024 at 06:04:56PM +0000, kaiyang2@cs.cmu.edu wrote:
> From: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
> 
> 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().
> 
> Signed-off-by: Kaiyang Zhao <kaiyang2@cs.cmu.edu>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>


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

* Re: [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node
  2024-08-01 18:04 [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node kaiyang2
  2024-08-01 19:04 ` Johannes Weiner
@ 2024-08-02  2:40 ` Baolin Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2024-08-02  2:40 UTC (permalink / raw)
  To: kaiyang2, linux-mm; +Cc: akpm, hannes



On 2024/8/2 02:04, kaiyang2@cs.cmu.edu wrote:
> From: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
> 
> 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().
> 
> Signed-off-by: Kaiyang Zhao <kaiyang2@cs.cmu.edu>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   mm/migrate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 8578a930cad1..aa482c954cb0 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -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;
>   	}


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

end of thread, other threads:[~2024-08-02  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01 18:04 [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node kaiyang2
2024-08-01 19:04 ` Johannes Weiner
2024-08-02  2:40 ` Baolin Wang

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