[PATCH] mm/mm_init.c: set zone's ->managed_pages as ->present_pages for now

From: Baoquan He
Date: Thu Mar 28 2024 - 04:20:15 EST


Because page_group_by_mobility_disabled need be set according to zone's
managed_pages later.

Signed-off-by: Baoquan He <bhe@xxxxxxxxxx>
---
mm/mm_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index cc24e7958c0c..dd875f943cbb 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -1561,7 +1561,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat)
* Initialize zone->managed_pages as 0 , it will be reset
* when memblock allocator frees pages into buddy system.
*/
- zone_init_internals(zone, j, nid, 0);
+ zone_init_internals(zone, j, nid, zone->present_pages);

if (!size)
continue;
--
2.41.0


>
> if (!size)
> continue;
> @@ -1915,6 +1878,7 @@ void __init free_area_init(unsigned long *max_zone_pfn)
> check_for_memory(pgdat);
> }
>
> + calc_nr_kernel_pages();
> memmap_init();
>
> /* disable hash distribution for systems with a single node */
> --
> 2.41.0
>