Thread (13 messages) flat view 13 messages, 2 authors, 2016-05-03

[RFC 4/7] powerpc/mm: Set MAX_ZONE_PFN to 0 for all zones beyond TOP_ZONE

From: Anshuman Khandual <hidden>
Date: 2016-05-03 06:30:26
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

From: Oliver O'Halloran <oohall@gmail.com>

All the memory zones past TOP_ZONE are managed by generic mm code. Zone
max PFN should be set to 0 instead of ~0UL since that's what the generic
mm code expects. Without this, kernel assigns all pages into ZONE_DEVICE
zone which is not part of buddy allocator, hence kernel cannot allocate
any memory and even fails to boot.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/mm/mem.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index bcaede4..19d2c62 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -242,8 +242,14 @@ static int __init mark_nonram_nosave(void)
 
 static bool zone_limits_final;
 
+/*
+ * The memory zones past TOP_ZONE are managed by generic mm code.
+ * Zone max PFN should be set to 0 instead of ~0UL since that's
+ * what the generic mm code expects.
+ */
 static unsigned long max_zone_pfns[MAX_NR_ZONES] = {
-	[0 ... MAX_NR_ZONES - 1] = ~0UL
+	[0        ... TOP_ZONE     - 1] = ~0UL,
+	[TOP_ZONE ... MAX_NR_ZONES - 1] = 0
 };
 
 /*
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help