aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/huge_mm.h
diff options
context:
space:
mode:
authorYang Shi <shy828301@gmail.com>2022-06-16 10:48:39 -0700
committerakpm <akpm@linux-foundation.org>2022-07-17 17:14:33 -0700
commit1064026bab9f011bdea1251d44d66bbbcee04f6e (patch)
tree13d20433b8a8316fc86dd07c45f07b06aad6e58c /include/linux/huge_mm.h
parentmm: thp: kill __transhuge_page_enabled() (diff)
downloadwireguard-linux-1064026bab9f011bdea1251d44d66bbbcee04f6e.tar.xz
wireguard-linux-1064026bab9f011bdea1251d44d66bbbcee04f6e.zip
mm: khugepaged: reorg some khugepaged helpers
The khugepaged_{enabled|always|req_madv} are not khugepaged only anymore, move them to huge_mm.h and rename to hugepage_flags_xxx, and remove khugepaged_req_madv due to no users. Also move khugepaged_defrag to khugepaged.c since its only caller is in that file, it doesn't have to be in a header file. Link: https://lkml.kernel.org/r/20220616174840.1202070-7-shy828301@gmail.com Signed-off-by: Yang Shi <shy828301@gmail.com> Reviewed-by: Zach O'Keefe <zokeefe@google.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Miaohe Lin <linmiaohe@huawei.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r--include/linux/huge_mm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index cd8a6c5d9fe5..ae3d8e2fd9e2 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -116,6 +116,14 @@ extern struct kobj_attribute shmem_enabled_attr;
extern unsigned long transparent_hugepage_flags;
+#define hugepage_flags_enabled() \
+ (transparent_hugepage_flags & \
+ ((1<<TRANSPARENT_HUGEPAGE_FLAG) | \
+ (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)))
+#define hugepage_flags_always() \
+ (transparent_hugepage_flags & \
+ (1<<TRANSPARENT_HUGEPAGE_FLAG))
+
/*
* Do the below checks:
* - For file vma, check if the linear page offset of vma is