summaryrefslogtreecommitdiff
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-02-01 04:25:17 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-02-01 04:25:17 +0300
commit5ab0fc155dc0cac3b74584f7bc972569b0f8a57b (patch)
treefb43458b715be3a72c872bc4ce0e7c45e6f76ccb /include/linux/hugetlb.h
parent9a3f21fe5cb9f5654ccad7ba712d868f7de66e39 (diff)
parentac86f547ca1002aec2ef66b9e64d03f45bbbfbb9 (diff)
downloadlinux-5ab0fc155dc0cac3b74584f7bc972569b0f8a57b.tar.xz
Sync mm-stable with mm-hotfixes-stable to pick up dependent patches
Merge branch 'mm-hotfixes-stable' into mm-stable
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index e3aa336df900..7d6413c3b8f5 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -8,6 +8,7 @@
#include <linux/fs.h>
#include <linux/hugetlb_inline.h>
#include <linux/cgroup.h>
+#include <linux/page_ref.h>
#include <linux/list.h>
#include <linux/kref.h>
#include <linux/pgtable.h>
@@ -1225,6 +1226,18 @@ static inline __init void hugetlb_cma_reserve(int order)
}
#endif
+#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
+static inline bool hugetlb_pmd_shared(pte_t *pte)
+{
+ return page_count(virt_to_page(pte)) > 1;
+}
+#else
+static inline bool hugetlb_pmd_shared(pte_t *pte)
+{
+ return false;
+}
+#endif
+
bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr);
#ifndef __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE