未验证 提交 a5ef7db5 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1796 arm64: enable THP_SWAP for arm64

Merge Pull Request from: @ci-robot 
 
PR sync from: Jinjiang Tu <tujinjiang@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/SSNB2TJLFOGTWITPC5QTJ4DGB4WFMNJF/ 
 
https://gitee.com/openeuler/kernel/issues/I7TVRF 
 
Link:https://gitee.com/openeuler/kernel/pulls/1796 

Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> 
Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
...@@ -86,6 +86,7 @@ config ARM64 ...@@ -86,6 +86,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_WANT_RESERVE_CRASH_KERNEL if KEXEC_CORE 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 ARCH_HAS_UBSAN_SANITIZE_ALL
select ARM_AMBA select ARM_AMBA
select ARM_ARCH_TIMER select ARM_ARCH_TIMER
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,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
......
...@@ -499,4 +499,16 @@ static inline unsigned long thp_size(struct page *page) ...@@ -499,4 +499,16 @@ static inline unsigned long thp_size(struct page *page)
return PAGE_SIZE << thp_order(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 */ #endif /* _LINUX_HUGE_MM_H */
...@@ -436,7 +436,7 @@ swp_entry_t get_swap_page(struct page *page) ...@@ -436,7 +436,7 @@ swp_entry_t get_swap_page(struct page *page)
goto out; goto out;
if (PageTransHuge(page)) { 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); get_swap_pages(1, &entry, HPAGE_PMD_NR, type);
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册