From f17e2a879df716db843d744ecf8782d1bcaf13c6 Mon Sep 17 00:00:00 2001 From: Sung-hun Kim Date: Wed, 8 Sep 2021 17:07:36 +0900 Subject: [PATCH] asm-generic: THP: fix bugs in asm-generic headers Since a function is defined in two headers at the same time, the kernel build is failed. And, a vm_fault_t-typed function does not return any values. This patch fixes two bugs in asm-generic headers. Fixes: 7d5372737d34 ("mm: THP: introducing a fine-grained transparent hugepage technique for ARM64 architecture") Change-Id: I84110bbb6c7f5b0794c55b3aca98419f12469eca Signed-off-by: Sung-hun Kim --- include/asm-generic/finegrained_thp.h | 1 + include/asm-generic/huge_mm.h | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/asm-generic/finegrained_thp.h b/include/asm-generic/finegrained_thp.h index 08a3461..35c9031 100644 --- a/include/asm-generic/finegrained_thp.h +++ b/include/asm-generic/finegrained_thp.h @@ -1,6 +1,7 @@ /* a generic header for fine-grained thp */ #ifndef __ASM_FINEGRAINED_THP_H #define __ASM_FINEGRAINED_THP_H +#ifndef CONFIG_FINEGRAINED_THP static inline void khugepaged_mem_hook(struct mm_struct *mm, unsigned long addr, long diff, const char *debug) {} diff --git a/include/asm-generic/huge_mm.h b/include/asm-generic/huge_mm.h index 48527cf..6714d0e 100644 --- a/include/asm-generic/huge_mm.h +++ b/include/asm-generic/huge_mm.h @@ -24,13 +24,11 @@ static inline pte_t arch_make_huge_pte(struct page *hpage, return mk_pte(hpage, vma->vm_page_prot); } -static inline void khugepaged_mem_hook(struct mm_struct *mm, - unsigned long addr, long diff, const char *debug) -{} - static inline vm_fault_t arch_do_set_huge_pte(struct vm_fault *vmf, struct page *page) -{} +{ + return VM_FAULT_FALLBACK; +} static inline void arch_set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned long headoff) -- 2.7.4