diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2006-04-28 01:02:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-04-28 01:02:51 -0400 |
commit | f10a04c034c7285a1b15dfa4a83d3e56578e34e8 (patch) | |
tree | ee6bd0c670b6606017cbd88b56a1247ff241e00e /include | |
parent | 37e53db8aa233c65142d63b496277bf5be9c0ade (diff) |
[PATCH] powerpc: Fix pagetable bloat for hugepages
At present, ARCH=powerpc kernels can waste considerable space in
pagetables when making large hugepage mappings. Hugepage PTEs go in
PMD pages, but each PMD page maps 256M and so contains only 16
hugepage PTEs (128 bytes of data), but takes up a 1024 byte
allocation. With CONFIG_PPC_64K_PAGES enabled (64k base page size),
the situation is worse. Now hugepage PTEs are at the PTE page level
(also mapping 256M), so we store 16 hugepage PTEs in a 64k allocation.
The PowerPC MMU already means that any 256M region is either all
hugepage, or all normal pages. Thus, with some care, we can use a
different allocation for the hugepage PTE tables and only allocate the
128 bytes necessary.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/page_64.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/pgalloc.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 3fb061bab9ec..eab779c21995 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h | |||
@@ -101,6 +101,7 @@ extern unsigned int HPAGE_SHIFT; | |||
101 | - (1U << GET_HTLB_AREA(addr))) & 0xffff) | 101 | - (1U << GET_HTLB_AREA(addr))) & 0xffff) |
102 | 102 | ||
103 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE | 103 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE |
104 | #define ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
104 | #define ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 105 | #define ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
105 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | 106 | #define ARCH_HAS_SETCLEAR_HUGE_PTE |
106 | 107 | ||
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h index a00ee002cd11..9f0917c68659 100644 --- a/include/asm-powerpc/pgalloc.h +++ b/include/asm-powerpc/pgalloc.h | |||
@@ -17,11 +17,13 @@ extern kmem_cache_t *pgtable_cache[]; | |||
17 | #define PTE_CACHE_NUM 0 | 17 | #define PTE_CACHE_NUM 0 |
18 | #define PMD_CACHE_NUM 1 | 18 | #define PMD_CACHE_NUM 1 |
19 | #define PGD_CACHE_NUM 2 | 19 | #define PGD_CACHE_NUM 2 |
20 | #define HUGEPTE_CACHE_NUM 3 | ||
20 | #else | 21 | #else |
21 | #define PTE_CACHE_NUM 0 | 22 | #define PTE_CACHE_NUM 0 |
22 | #define PMD_CACHE_NUM 1 | 23 | #define PMD_CACHE_NUM 1 |
23 | #define PUD_CACHE_NUM 1 | 24 | #define PUD_CACHE_NUM 1 |
24 | #define PGD_CACHE_NUM 0 | 25 | #define PGD_CACHE_NUM 0 |
26 | #define HUGEPTE_CACHE_NUM 2 | ||
25 | #endif | 27 | #endif |
26 | 28 | ||
27 | /* | 29 | /* |