mm: page_alloc: call panic() when memoryless node allocation fails
In free_area_init(), we will continue to run after allocation of memoryless node pgdat fails. However, in the subsequent process (such as when initializing zonelist), the case that NODE_DATA(nid) is NULL is not handled, which will cause panic. Instead of this, it's better to call panic() directly when the memory allocation fails during system boot. Link: https://lkml.kernel.org/r/20230212111027.95520-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
9f550d78b4
commit
1bc67ca65b
|
@ -8405,11 +8405,9 @@ void __init free_area_init(unsigned long *max_zone_pfn)
|
||||||
|
|
||||||
/* Allocator not initialized yet */
|
/* Allocator not initialized yet */
|
||||||
pgdat = arch_alloc_nodedata(nid);
|
pgdat = arch_alloc_nodedata(nid);
|
||||||
if (!pgdat) {
|
if (!pgdat)
|
||||||
pr_err("Cannot allocate %zuB for node %d.\n",
|
panic("Cannot allocate %zuB for node %d.\n",
|
||||||
sizeof(*pgdat), nid);
|
sizeof(*pgdat), nid);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
arch_refresh_nodedata(nid, pgdat);
|
arch_refresh_nodedata(nid, pgdat);
|
||||||
free_area_init_memoryless_node(nid);
|
free_area_init_memoryless_node(nid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue