Commit 03939cf0 authored by Will Deacon's avatar Will Deacon

Merge branch 'for-next/mm' into for-next/core

* for-next/mm:
  arm64: enable THP_SWAP for arm64
parents 02eab44c d0637c50
...@@ -101,6 +101,7 @@ config ARM64 ...@@ -101,6 +101,7 @@ config ARM64
select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANT_LD_ORPHAN_WARN
select ARCH_WANTS_NO_INSTR select ARCH_WANTS_NO_INSTR
select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_HAS_UBSAN_SANITIZE_ALL
select ARM_AMBA select ARM_AMBA
select ARM_ARCH_TIMER select ARM_ARCH_TIMER
......
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
__flush_tlb_range(vma, addr, end, PUD_SIZE, false, 1) __flush_tlb_range(vma, addr, end, PUD_SIZE, false, 1)
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
static inline bool arch_thp_swp_supported(void)
{
return !system_supports_mte();
}
#define arch_thp_swp_supported arch_thp_swp_supported
/* /*
* Outside of a few very special situations (e.g. hibernation), we always * Outside of a few very special situations (e.g. hibernation), we always
* use broadcast TLB invalidation instructions, therefore a spurious page * use broadcast TLB invalidation instructions, therefore a spurious page
......
...@@ -461,4 +461,16 @@ static inline int split_folio_to_list(struct folio *folio, ...@@ -461,4 +461,16 @@ static inline int split_folio_to_list(struct folio *folio,
return split_huge_page_to_list(&folio->page, list); return split_huge_page_to_list(&folio->page, list);
} }
/*
* archs that select ARCH_WANTS_THP_SWAP but don't support THP_SWP due to
* limitations in the implementation like arm64 MTE can override this to
* false
*/
#ifndef arch_thp_swp_supported
static inline bool arch_thp_swp_supported(void)
{
return true;
}
#endif
#endif /* _LINUX_HUGE_MM_H */ #endif /* _LINUX_HUGE_MM_H */
...@@ -307,7 +307,7 @@ swp_entry_t folio_alloc_swap(struct folio *folio) ...@@ -307,7 +307,7 @@ swp_entry_t folio_alloc_swap(struct folio *folio)
entry.val = 0; entry.val = 0;
if (folio_test_large(folio)) { if (folio_test_large(folio)) {
if (IS_ENABLED(CONFIG_THP_SWAP)) if (IS_ENABLED(CONFIG_THP_SWAP) && arch_thp_swp_supported())
get_swap_pages(1, &entry, folio_nr_pages(folio)); get_swap_pages(1, &entry, folio_nr_pages(folio));
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment