Re: [PATCH 2/2] mm/page_owner: simplify zone iteration logic in init_early_allocated_pages()
From: Vlastimil Babka
Date: Wed Oct 01 2025 - 09:44:45 EST
On 9/30/25 11:21 AM, Hu Song wrote:
> From: Song Hu <husong@xxxxxxxxxx>
>
> The current implementation uses nested loops: first iterating over all
> online nodes, then over zones within each node. This can be simplified
> by using the for_each_populated_zone() macro which directly iterates
> through all populated zones.
>
> This change:
> 1. Removes the intermediate init_zones_in_node() function
> 2. Simplifies init_early_allocated_pages() to use direct zone iteration
> 3. Updates init_pages_in_zone() to take only zone parameter and access
> node_id via zone->zone_pgdat
>
> The functionality remains identical, but the code is cleaner and more
> maintainable.
>
> Signed-off-by: Song Hu <husong@xxxxxxxxxx>
LGTM.
Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>