Skip to content

Commit a0820ff

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm:book3s: Enable THP migration support
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 8890e03 commit a0820ff

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static inline bool pte_user(pte_t pte)
741741
*/
742742
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) & ~_PAGE_PTE })
743743
#define __swp_entry_to_pte(x) __pte((x).val | _PAGE_PTE)
744+
#define __pmd_to_swp_entry(pmd) (__pte_to_swp_entry(pmd_pte(pmd)))
745+
#define __swp_entry_to_pmd(x) (pte_pmd(__swp_entry_to_pte(x)))
744746

745747
#ifdef CONFIG_MEM_SOFT_DIRTY
746748
#define _PAGE_SWP_SOFT_DIRTY (1UL << (SWP_TYPE_BITS + _PAGE_BIT_SWAP_TYPE))
@@ -1091,6 +1093,12 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd)
10911093
#define pmd_soft_dirty(pmd) pte_soft_dirty(pmd_pte(pmd))
10921094
#define pmd_mksoft_dirty(pmd) pte_pmd(pte_mksoft_dirty(pmd_pte(pmd)))
10931095
#define pmd_clear_soft_dirty(pmd) pte_pmd(pte_clear_soft_dirty(pmd_pte(pmd)))
1096+
1097+
#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
1098+
#define pmd_swp_mksoft_dirty(pmd) pte_pmd(pte_swp_mksoft_dirty(pmd_pte(pmd)))
1099+
#define pmd_swp_soft_dirty(pmd) pte_swp_soft_dirty(pmd_pte(pmd))
1100+
#define pmd_swp_clear_soft_dirty(pmd) pte_pmd(pte_swp_clear_soft_dirty(pmd_pte(pmd)))
1101+
#endif
10941102
#endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */
10951103

10961104
#ifdef CONFIG_NUMA_BALANCING

arch/powerpc/platforms/Kconfig.cputype

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config PPC_BOOK3S_64
7272
select PPC_HAVE_PMU_SUPPORT
7373
select SYS_SUPPORTS_HUGETLBFS
7474
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
75+
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
7576
select ARCH_SUPPORTS_NUMA_BALANCING
7677
select IRQ_WORK
7778

0 commit comments

Comments
 (0)