Re: [PATCH v3 2/4] mm/page_isolation: remove migratetype from move_freepages_block_isolate()

Zi Yan
2025-05-08T20:24:03Z

On 7 May 2025, at 17:10, Zi Yan wrote:

> Since migratetype is no longer overwritten during pageblock isolation,
> moving pageblocks to and from MIGRATE_ISOLATE no longer needs migratetype.
>
> Add MIGRATETYPE_NO_ISO_MASK to allow read before-isolation migratetype
> when a pageblock is isolated. It is used by move_freepages_block_isolate().
>
> Add pageblock_isolate_and_move_free_pages() and
> pageblock_unisolate_and_move_free_pages() to be explicit about the page
> isolation operations. Both share the common code in
> __move_freepages_block_isolate(), which is renamed from
> move_freepages_block_isolate().
>
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> ---
> include/linux/mmzone.h | 4 ++-
> include/linux/page-isolation.h | 4 +--
> mm/page_alloc.c | 49 +++++++++++++++++++++++++++-------
> mm/page_isolation.c | 21 +++++++--------
> 4 files changed, 55 insertions(+), 23 deletions(-)
>

Here is the fixup 2/3 to address Johannes’ comments.

From 4e6fddf64c07da8796ff6ca90703a5aa64302a90 Mon Sep 17 00:00:00 2001
From: Zi Yan <ziy@nvidia.com>
Date: Thu, 8 May 2025 15:23:42 -0400
Subject: [PATCH] fixup for mm/page_isolation: remove migratetype from
move_freepages_block_isolate()

1. replace get_pageblock_isolate() with
get_pageblock_migratetype() == MIGRATE_ISOLATE, a
get_pageblock_isolate() becomes private in mm/page_isolation.c

Signed-off-by: Zi Yan <ziy@nvidia.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b502e4a3afbe..c99b77fdf383 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1975,7 +1975,7 @@ static bool __move_freepages_block_isolate(struct zone *zone,
int from_mt;
int to_mt;

- if (isolate == get_pageblock_isolate(page))
+ if (isolate == (get_pageblock_migratetype(page) == MIGRATE_ISOLATE))
return false;

if (!prep_move_freepages_block(zone, page, &start_pfn, NULL, NULL))
--
2.47.2

Best Regards,
Yan, Zi