Re: [PATCH 0/4] mm/mm_init: simplify zone_spanned_pages_in_node()

From: Sang-Heon Jeon

Date: Thu Aug 06 2026 - 10:52:18 EST


On Tue, Aug 4, 2026 at 11:48 PM Sang-Heon Jeon <ekffu200098@xxxxxxxxx> wrote:
>
> Hello,
>
> This series simplifies zone_spanned_pages_in_node(), which adjusts
> *zone_start_pfn and *zone_end_pfn before and after calling
> adjust_zone_range_for_zone_movable(). The helper adjusts the same two
> values, which makes the code harder to follow.
>
> Split into four patches for easier review. Squashing them into one
> patch when applying is also fine.
>
> Patch 1 folds adjust_zone_range_for_zone_movable() into the caller.
>
> Patch 2 removes the clamping to node_end_pfn, which has no effect.
>
> Patch 3 moves the check and the clamping to node_start_pfn into the
> ZONE_MOVABLE branch, which is the only place they have an effect.
>
> Patch 4 extracts a local variable and reduces the indentation level.
>
> No functional change.
>
> Sang-Heon Jeon (4):
> mm/mm_init: fold adjust_zone_range_for_zone_movable() into its sole
> caller
> mm/mm_init: remove redundant clamping in zone_spanned_pages_in_node()
> mm/mm_init: move the range check and clamping inside ZONE_MOVABLE
> branch
> mm/mm_init: clean up zone_spanned_pages_in_node()

A series changing the kernelcore=mirror behavior [1] has already been
merged into memblock/for-next. I'll rebase and send v2.

[1] https://lore.kernel.org/all/20260630072212.624305-1-rppt@xxxxxxxxxx/

> mm/mm_init.c | 81 ++++++++++++++++++++++++----------------------------
> 1 file changed, 37 insertions(+), 44 deletions(-)
>
> --
> 2.43.0
>