summaryrefslogtreecommitdiffstats
path: root/x86-Limit-32bit-PAE-memory-to-16G.patch
blob: 439d96c5d7039aedf923fd410bdb1643dd7c011f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 9c50553cb28d0543e983b17b515f50dc5b57d21e 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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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