| From 2da92b60dd58ce7613a909165cbd84cb69217b7d Mon Sep 17 00:00:00 2001 |
| From: Luis Claudio R. Goncalves <lgoncalv@redhat.com> |
| 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 <mschmidt@redhat.com> |
| Signed-off-by: Clark Williams <williams@redhat.com> |
| Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h |
| index 18e496c..32a748a 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 a1a7876..5158861 100644 |
| --- a/arch/x86/kernel/e820.c |
| +++ b/arch/x86/kernel/e820.c |
| @@ -1136,6 +1136,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.1.1 |
| |