From 9c50553cb28d0543e983b17b515f50dc5b57d21e Mon Sep 17 00:00:00 2001 From: Luis Claudio R. Goncalves Date: Thu, 9 Sep 2010 21:13:28 +0200 Subject: [PATCH] x86: Limit 32bit PAE memory to 16G commit 2da92b60dd58ce7613a909165cbd84cb69217b7d in tip. This patch limits the amount of usable physical RAM to 16 GB on i386. It solves bug 311411 "[RHEL5 RT] Kernel panic - not syncing: Out of memory". The crash was caused by running out of low memory while allocating the memory map on machines equipped with more than ~56 GB RAM. The realtime kernel does not like having too much RAM because it has larger struct page then the normal kernel. The officially supported amount of RAM on i386 RHEL-5 is 16 GB anyway. Originally-From: Michal Schmidt Signed-off-by: Clark Williams Signed-off-by: Luis Claudio R. Goncalves Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- arch/x86/include/asm/setup.h | 1 + arch/x86/kernel/e820.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 86b1506..efaa903 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -13,6 +13,7 @@ */ #define MAXMEM_PFN PFN_DOWN(MAXMEM) #define MAX_NONPAE_PFN (1 << 20) +#define MAX_SANE_PAE_PFN (1 << 22) #endif /* __i386__ */ diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 7bca3c6..77a635e 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -871,6 +871,17 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) if (start_pfn >= limit_pfn) continue; +#ifdef CONFIG_X86_32 + if (end_pfn > MAX_SANE_PAE_PFN) { + last_pfn = MAX_SANE_PAE_PFN; + printk(KERN_WARNING + "WARNING: Running a 32 bit kernel with more " + "than 16 GB RAM is not supported on MRG RT.\n" + "Using only 16 GB. To take advantage of all " + "of your RAM, use a x86_64 kernel.\n"); + break; + } +#endif if (end_pfn > limit_pfn) { last_pfn = limit_pfn; break; -- 1.7.0.4