mm: backport mm_init.c to bring init_reserved_page optimisations
JIRA: https://issues.redhat.com/browse/RHEL-36126
Bring a DEFERRED_STRUCT_PAGE_INIT optimisations ([1]) to improve boot times for the automotive use-case.
The following path is improved by avoiding to take the lock when not necessary:
-> reserve_bootmem_region
-> init_reserved_page
-> early_pfn_to_nid
-> spin_lock(&early_pfn_lock)
-> __early_pfn_to_nid
-> memblock_search_pfn_nid()
-> memblock_search()
-> spin_unlock(&early_pfn_lock)
On sa8775p-ride (using automotive configuration), this saves ~30ms before time_init() is called, which makes it hard to observe.
Signed-off-by: Eric Chanudet echanude@redhat.com
Edited by Eric Chanudet