[PATCH 2/4] x86-32: Increment SECTION_SIZE_BITS to 30 when X86_PAE

From: Tejun Heo
Date: Thu Mar 31 2011 - 14:03:31 EST


When X86_PAE is enabled, SECTION_SIZE_BITS is 29 and MAX_PHYSADDR_BITS
36 making SECTIONS_WIDTH 7, which is different from !X86_PAE case
where the width is 6. On x86, when all the related options are
enabled, NR_PAGEFLAGS reaches 26 and thus can accomodate only 6 more
bits, not 7.

This direcrepancy leads to confusing Kconfig restrictions like
disabling of ARCH_SUPPORTS_MEMORY_FAILURE depending on combinations of
options.

This patch bumps SECTION_SIZE_BITS to 30 when X86_PAE. This change
increases sparse memory model granuality from 512MiB to 1GiB which in
turn can increase the amount of wasted memory in memmap when the
memory sections aren't aligned. The amount of wastage can be a few
MiB per unaligned section.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
arch/x86/include/asm/sparsemem.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h
index 4517d6b..71b8671 100644
--- a/arch/x86/include/asm/sparsemem.h
+++ b/arch/x86/include/asm/sparsemem.h
@@ -16,7 +16,7 @@

#ifdef CONFIG_X86_32
# ifdef CONFIG_X86_PAE
-# define SECTION_SIZE_BITS 29
+# define SECTION_SIZE_BITS 30
# define MAX_PHYSADDR_BITS 36
# define MAX_PHYSMEM_BITS 36
# else
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/