Unverified Commit a5ef7db5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 90b62eb2 2b16e8ef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ config ARM64
	select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANT_RESERVE_CRASH_KERNEL if KEXEC_CORE
	select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
	select ARCH_HAS_UBSAN_SANITIZE_ALL
	select ARM_AMBA
	select ARM_ARCH_TIMER
+6 −0
Original line number Diff line number Diff line
@@ -46,6 +46,12 @@
	__flush_tlb_range(vma, addr, end, PUD_SIZE, false, 1)
#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
 * use broadcast TLB invalidation instructions, therefore a spurious page
+12 −0
Original line number Diff line number Diff line
@@ -499,4 +499,16 @@ static inline unsigned long thp_size(struct page *page)
	return PAGE_SIZE << thp_order(page);
}

/*
 * 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 */
+1 −1
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ swp_entry_t get_swap_page(struct page *page)
		goto out;

	if (PageTransHuge(page)) {
		if (IS_ENABLED(CONFIG_THP_SWAP))
		if (IS_ENABLED(CONFIG_THP_SWAP) && arch_thp_swp_supported())
			get_swap_pages(1, &entry, HPAGE_PMD_NR, type);
		goto out;
	}