Skip to content

Commit ec94e5c

Browse files
committed
mm/mm_init.c: print mem_init info after defer_init is done
JIRA: https://issues.redhat.com/browse/RHEL-85565 commit 4f66da8 Author: Wei Yang <richard.weiyang@gmail.com> Date: Tue Jun 11 14:52:23 2024 +0000 mm/mm_init.c: print mem_init info after defer_init is done Current call flow looks like this: start_kernel mm_core_init mem_init mem_init_print_info rest_init kernel_init kernel_init_freeable page_alloc_init_late deferred_init_memmap If CONFIG_DEFERRED_STRUCT_PAGE_INIT, the time mem_init_print_info() calls, pages are not totally initialized and freed to buddy. This has one issue * nr_free_pages() just contains partial free pages in the system, which is not we expect. Let's print the mem info after defer_init is done. Also this would help changing totalram_pages accounting, since we plan to move the accounting into __free_pages_core(). Link: https://lkml.kernel.org/r/20240611145223.16872-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: Mike Rapoport (IBM) <rppt@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Eric Chanudet <echanude@redhat.com>
1 parent 2f93fda commit ec94e5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/mm_init.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,6 +2368,7 @@ void set_zone_contiguous(struct zone *zone)
23682368
zone->contiguous = true;
23692369
}
23702370

2371+
static void __init mem_init_print_info(void);
23712372
void __init page_alloc_init_late(void)
23722373
{
23732374
struct zone *zone;
@@ -2394,6 +2395,8 @@ void __init page_alloc_init_late(void)
23942395
files_maxfiles_init();
23952396
#endif
23962397

2398+
/* Accounting of total+free memory is stable at this point. */
2399+
mem_init_print_info();
23972400
buffer_init();
23982401

23992402
/* Discard memblock private memory */
@@ -2772,7 +2775,6 @@ void __init mm_core_init(void)
27722775
kmsan_init_shadow();
27732776
stack_depot_early_init();
27742777
mem_init();
2775-
mem_init_print_info();
27762778
kmem_cache_init();
27772779
/*
27782780
* page_owner must be initialized after buddy is ready, and also after

0 commit comments

Comments
 (0)