diff options
author | Nitin Gupta <nitin.m.gupta@oracle.com> | 2016-07-29 09:54:21 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-29 19:49:16 +0200 |
commit | 7bc3777ca19cf9ecc5533980210f29c51df7fe5e (patch) | |
tree | baaa60bd0a6dfe46a902d7e151005b013f340e7f /arch/sparc/include/asm/pgtable_64.h | |
parent | sparc64 mm: Fix base TSB sizing when hugetlb pages are used (diff) | |
download | linux-7bc3777ca19cf9ecc5533980210f29c51df7fe5e.tar.xz linux-7bc3777ca19cf9ecc5533980210f29c51df7fe5e.zip |
sparc64: Trim page tables for 8M hugepages
For PMD aligned (8M) hugepages, we currently allocate
all four page table levels which is wasteful. We now
allocate till PMD level only which saves memory usage
from page tables.
Also, when freeing page table for 8M hugepage backed region,
make sure we don't try to access non-existent PTE level.
Orabug: 22630259
Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/pgtable_64.h')
-rw-r--r-- | arch/sparc/include/asm/pgtable_64.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index e7d82803a48f..1fb317fbc0b3 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -395,7 +395,7 @@ static inline unsigned long __pte_huge_mask(void) static inline pte_t pte_mkhuge(pte_t pte) { - return __pte(pte_val(pte) | __pte_huge_mask()); + return __pte(pte_val(pte) | _PAGE_PMD_HUGE | __pte_huge_mask()); } static inline bool is_hugetlb_pte(pte_t pte) @@ -403,6 +403,11 @@ static inline bool is_hugetlb_pte(pte_t pte) return !!(pte_val(pte) & __pte_huge_mask()); } +static inline bool is_hugetlb_pmd(pmd_t pmd) +{ + return !!(pmd_val(pmd) & _PAGE_PMD_HUGE); +} + #ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline pmd_t pmd_mkhuge(pmd_t pmd) { |