From 04519e317c60d1d245443b74ae0fef2af1d6241f Mon Sep 17 00:00:00 2001 From: Sung-hun Kim Date: Wed, 8 Sep 2021 17:18:37 +0900 Subject: [PATCH] mm: THP: workaround: only allow including specific headers for FINEGRAINED_THP configured cases asm/huge_mm.h and asm/finegrained_thp.h are only used for FINEGRAINED_THP-enabled kernel. Otherwise, such as arm which does not support contiguous PTE bit, disallow including them. Fixes: 7d5372737d34 ("mm: THP: introducing a fine-grained transparent hugepage technique for ARM64 architecture") Change-Id: I37c2bc46106711f4b7ee33a6838d87e929e13247 Signed-off-by: Sung-hun Kim --- mm/khugepaged.c | 2 ++ mm/memory.c | 5 +++++ mm/mmap.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index aa96e8e..34f0c40 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -21,8 +21,10 @@ #include #include +#ifdef CONFIG_FINEGRAINED_THP #include #include +#endif #include "internal.h" enum scan_result { diff --git a/mm/memory.c b/mm/memory.c index 08336046..bdf18e9 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -82,8 +82,13 @@ #include #include #include +#ifdef CONFIG_FINEGRAINED_THP #include #include +#else +#include +#include +#endif #include "pgalloc-track.h" #include "internal.h" diff --git a/mm/mmap.c b/mm/mmap.c index 02eb014..cca7268 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -52,7 +52,11 @@ #include #include #include +#ifdef CONFIG_FINEGRAINED_THP #include +#else +#include +#endif #define CREATE_TRACE_POINTS #include -- 2.7.4