Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/mm_init.c: don't initialize page->lru again

Current page initialization call flow looks like this with some
simplification:

setup_arch()
paging_init()
free_area_init()
memmap_init()
memmap_init_zone_range()
memmap_init_range()
defer_init()
__init_single_page()
mm_core_init()
mem_init()
memblock_free_all()
free_low_memory_core_early()
memmap_init_reserved_pages()
reserve_bootmem_region()
init_reserved_page()
__init_single_page()

There two cases depends on CONFIG_DEFERRED_STRUCT_PAGE_INIT.

* If CONFIG_DEFERRED_STRUCT_PAGE_INIT, pages after first_init_pfn is
skipped at defer_init(). Then init_reserved_page() is defined to
call __init_single_page() for them.
* If !CONFIG_DEFERRED_STRUCT_PAGE_INIT, pages are all initialized by
memmap_init_range().

In both cases, after init_reserved_page(), we expect __init_single_page()
has done its work to the page, which already initialize page->lru properly.

We don't need to do it again.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240610143742.26401-1-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>

authored by

Wei Yang and committed by
Mike Rapoport (IBM)
0e9899fe f1180fd2

-3
-3
mm/mm_init.c
··· 760 760 761 761 init_reserved_page(start_pfn, nid); 762 762 763 - /* Avoid false-positive PageTail() */ 764 - INIT_LIST_HEAD(&page->lru); 765 - 766 763 /* 767 764 * no need for atomic set_bit because the struct 768 765 * page is not visible yet so nobody should