Re: [PATCH 07/49] mm/mm_init: use pageblock_migratetype_init_range() in deferred_free_pages()
From: David Hildenbrand (Arm)
Date: Mon Apr 13 2026 - 14:54:57 EST
On 4/5/26 14:51, Muchun Song wrote:
> Simplify deferred_free_pages by replacing the duplicate loops for
> initializing pageblock migratetype with a call to
> pageblock_migratetype_init_range to simplify the code.
"Simplify ... to simplify the code."
Likely you can drop the last part.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> ---
> mm/mm_init.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index 4936ca78966c..a92c5053f63d 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1974,13 +1974,12 @@ static void __init deferred_free_pages(unsigned long pfn,
> if (!nr_pages)
> return;
>
> + pageblock_migratetype_init_range(pfn, nr_pages, MIGRATE_MOVABLE);
pageblock_migratetype_init_range() will align the PFN up to the next
pageblock.
Are we sure the range we are getting called with is always aligned to
pageblocks, such that we won't miss to initialize the first pageblock?
--
Cheers,
David