[RFC 4/7] powerpc/mm: Set MAX_ZONE_PFN to 0 for all zones beyond TOP_ZONE
Anshuman Khandual
khandual at linux.vnet.ibm.com
Tue May 3 16:29:23 AEST 2016
From: Oliver O'Halloran <oohall at 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 at 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
More information about the Linuxppc-dev
mailing list