Files
linux/mm
Song Hu ca30ac479e mm/page_owner: simplify zone iteration logic in init_early_allocated_pages()
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.

Link: https://lkml.kernel.org/r/20250930092153.843109-2-husong@kylinos.cn
Signed-off-by: Song Hu <husong@kylinos.cn>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Ye Liu <liuye@kylinos.cn>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-11-16 17:28:01 -08:00
..
2025-09-21 14:22:09 -07:00
2025-10-03 16:42:44 -07:00
2025-10-03 16:42:43 -07:00
2025-09-21 14:21:59 -07:00
2025-09-21 14:22:00 -07:00
2025-11-16 17:27:52 -08:00
2025-09-13 16:54:58 -07:00
2025-09-13 16:55:07 -07:00
2025-08-02 12:06:09 -07:00
2025-09-13 16:54:46 -07:00
2025-09-23 14:14:16 -07:00
2025-09-21 14:22:28 -07:00
2025-11-16 17:27:52 -08:00
2025-11-16 17:27:52 -08:00
2025-09-13 16:55:07 -07:00
2025-11-16 17:27:52 -08:00
2025-11-16 17:27:52 -08:00
2025-09-13 16:55:07 -07:00
2025-09-21 14:21:59 -07:00
2025-11-16 17:27:57 -08:00