aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3b337efbe533..66560f1a0564 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -19,6 +19,7 @@
19#include <linux/bit_spinlock.h> 19#include <linux/bit_spinlock.h>
20#include <linux/shrinker.h> 20#include <linux/shrinker.h>
21#include <linux/resource.h> 21#include <linux/resource.h>
22#include <linux/page_ext.h>
22 23
23struct mempolicy; 24struct mempolicy;
24struct anon_vma; 25struct anon_vma;
@@ -2155,20 +2156,36 @@ extern void copy_user_huge_page(struct page *dst, struct page *src,
2155 unsigned int pages_per_huge_page); 2156 unsigned int pages_per_huge_page);
2156#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ 2157#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
2157 2158
2159extern struct page_ext_operations debug_guardpage_ops;
2160extern struct page_ext_operations page_poisoning_ops;
2161
2158#ifdef CONFIG_DEBUG_PAGEALLOC 2162#ifdef CONFIG_DEBUG_PAGEALLOC
2159extern unsigned int _debug_guardpage_minorder; 2163extern unsigned int _debug_guardpage_minorder;
2164extern bool _debug_guardpage_enabled;
2160 2165
2161static inline unsigned int debug_guardpage_minorder(void) 2166static inline unsigned int debug_guardpage_minorder(void)
2162{ 2167{
2163 return _debug_guardpage_minorder; 2168 return _debug_guardpage_minorder;
2164} 2169}
2165 2170
2171static inline bool debug_guardpage_enabled(void)
2172{
2173 return _debug_guardpage_enabled;
2174}
2175
2166static inline bool page_is_guard(struct page *page) 2176static inline bool page_is_guard(struct page *page)
2167{ 2177{
2168 return test_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags); 2178 struct page_ext *page_ext;
2179
2180 if (!debug_guardpage_enabled())
2181 return false;
2182
2183 page_ext = lookup_page_ext(page);
2184 return test_bit(PAGE_EXT_DEBUG_GUARD, &page_ext->flags);
2169} 2185}
2170#else 2186#else
2171static inline unsigned int debug_guardpage_minorder(void) { return 0; } 2187static inline unsigned int debug_guardpage_minorder(void) { return 0; }
2188static inline bool debug_guardpage_enabled(void) { return false; }
2172static inline bool page_is_guard(struct page *page) { return false; } 2189static inline bool page_is_guard(struct page *page) { return false; }
2173#endif /* CONFIG_DEBUG_PAGEALLOC */ 2190#endif /* CONFIG_DEBUG_PAGEALLOC */
2174 2191