Skip to content

Commit 4a7aa4f

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/hash64: Allocate larger PMD table if hugetlb config is enabled
We use the second half of the page table to store slot information, so we must allocate it always if hugetlb is possible. Fixes: bf9a95f ("powerpc: Free up four 64K PTE bits in 64K backed HPTE pages") Signed-off-by: Aneesh Kumar K.V <[email protected]> Reviewed-by: Ram Pai <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent fae2211 commit 4a7aa4f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

arch/powerpc/include/asm/book3s/64/hash-64k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static inline int hash__remap_4k_pfn(struct vm_area_struct *vma, unsigned long a
140140
}
141141

142142
#define H_PTE_TABLE_SIZE PTE_FRAG_SIZE
143-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
143+
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined (CONFIG_HUGETLB_PAGE)
144144
#define H_PMD_TABLE_SIZE ((sizeof(pmd_t) << PMD_INDEX_SIZE) + \
145145
(sizeof(unsigned long) << PMD_INDEX_SIZE))
146146
#else

arch/powerpc/include/asm/book3s/64/hash.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
H_PUD_INDEX_SIZE + H_PGD_INDEX_SIZE + PAGE_SHIFT)
2424
#define H_PGTABLE_RANGE (ASM_CONST(1) << H_PGTABLE_EADDR_SIZE)
2525

26-
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_PPC_64K_PAGES)
26+
#if (defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE)) && \
27+
defined(CONFIG_PPC_64K_PAGES)
2728
/*
2829
* only with hash 64k we need to use the second half of pmd page table
2930
* to store pointer to deposited pgtable_t

0 commit comments

Comments
 (0)