Thread (55 messages) 55 messages, 12 authors, 2019-10-02

Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

From: Mike Rapoport <hidden>
Date: 2019-01-25 19:33:19
Also in: linux-alpha, linux-arm-kernel, linux-devicetree, linux-mips, linux-mm, linux-s390, linux-sh, linux-um, linux-usb, lkml, sparclinux

On Fri, Jan 25, 2019 at 05:45:02PM +0000, Catalin Marinas wrote:
On Mon, Jan 21, 2019 at 10:03:53AM +0200, Mike Rapoport wrote:
quoted
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index ae34e3a..2c61ea4 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -237,6 +237,10 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
 		pr_info("Initmem setup node %d [<memory-less node>]\n", nid);
 
 	nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
+	if (!nd_pa)
+		panic("Cannot allocate %zu bytes for node %d data\n",
+		      nd_size, nid);
+
 	nd = __va(nd_pa);
 
 	/* report and initialize */
Does it mean that memblock_phys_alloc_try_nid() never returns valid
physical memory starting at 0?
Yes, it does.
memblock_find_in_range_node() that is used by all allocation methods
skips the first page [1].
 
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/memblock.c#n257
-- 
Catalin
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help