aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-04-30 01:41:48 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-15 06:49:25 -0400
commitcec08e7a948326b01555be6311480aa08e637de2 (patch)
treea08e1d91c9a0c5eaa4e81036a3d7f992b2de1745 /include/asm-powerpc
parent08fcf1d61193d7b7779aa6d7388535e26e064a0b (diff)
[POWERPC] vmemmap fixes to use smaller pages
This changes vmemmap to use a different region (region 0xf) of the address space, and to configure the page size of that region dynamically at boot. The problem with the current approach of always using 16M pages is that it's not well suited to machines that have small amounts of memory such as small partitions on pseries, or PS3's. In fact, on the PS3, failure to allocate the 16M page backing vmmemmap tends to prevent hotplugging the HV's "additional" memory, thus limiting the available memory even more, from my experience down to something like 80M total, which makes it really not very useable. The logic used by my match to choose the vmemmap page size is: - If 16M pages are available and there's 1G or more RAM at boot, use that size. - Else if 64K pages are available, use that - Else use 4K pages I've tested on a POWER6 (16M pages) and on an iSeries POWER3 (4K pages) and it seems to work fine. Note that I intend to change the way we organize the kernel regions & SLBs so the actual region will change from 0xf back to something else at one point, as I simplify the SLB miss handler, but that will be for a later patch. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/mmu-hash64.h1
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h10
2 files changed, 6 insertions, 5 deletions
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 0dff76776044..39c5c5f62bf5 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -177,6 +177,7 @@ extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
177extern int mmu_linear_psize; 177extern int mmu_linear_psize;
178extern int mmu_virtual_psize; 178extern int mmu_virtual_psize;
179extern int mmu_vmalloc_psize; 179extern int mmu_vmalloc_psize;
180extern int mmu_vmemmap_psize;
180extern int mmu_io_psize; 181extern int mmu_io_psize;
181extern int mmu_kernel_ssize; 182extern int mmu_kernel_ssize;
182extern int mmu_highuser_ssize; 183extern int mmu_highuser_ssize;
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
index 27f18695f7d6..cc6a43ba41d0 100644
--- a/include/asm-powerpc/pgtable-ppc64.h
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -65,15 +65,15 @@
65 65
66#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START)) 66#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
67#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET)) 67#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
68#define VMEMMAP_REGION_ID (0xfUL)
68#define USER_REGION_ID (0UL) 69#define USER_REGION_ID (0UL)
69 70
70/* 71/*
71 * Defines the address of the vmemap area, in the top 16th of the 72 * Defines the address of the vmemap area, in its own region
72 * kernel region.
73 */ 73 */
74#define VMEMMAP_BASE (ASM_CONST(CONFIG_KERNEL_START) + \ 74#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT)
75 (0xfUL << (REGION_SHIFT - 4))) 75#define vmemmap ((struct page *)VMEMMAP_BASE)
76#define vmemmap ((struct page *)VMEMMAP_BASE) 76
77 77
78/* 78/*
79 * Common bits in a linux-style PTE. These match the bits in the 79 * Common bits in a linux-style PTE. These match the bits in the