Commit 6a9531c
memblock: fix crash when reserved memory is not added to memory
After commit 61167ad ("mm: pass nid to reserve_bootmem_region()")
nid of a reserved region is used by init_reserved_page() (with
CONFIG_DEFERRED_STRUCT_PAGE_INIT=y) to access node strucure.
In many cases the nid of the reserved memory is not set and this causes
a crash.
When the nid of a reserved region is not set, fall back to
early_pfn_to_nid(), so that nid of the first_online_node will be passed
to init_reserved_page().
Fixes: 61167ad ("mm: pass nid to reserve_bootmem_region()")
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Link: https://lore.kernel.org/r/20240118061853.2652295-1-yajun.deng@linux.dev
[rppt: massaged the commit message]
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>1 parent 0dd3ee3 commit 6a9531c
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2141 | 2141 | | |
2142 | 2142 | | |
2143 | 2143 | | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
2144 | 2147 | | |
2145 | 2148 | | |
2146 | 2149 | | |
| |||
0 commit comments