aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmdebug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmdebug.h')
-rw-r--r--include/linux/mmdebug.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 2f348d02f640..877ef226f90f 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -4,10 +4,14 @@
4#include <linux/stringify.h> 4#include <linux/stringify.h>
5 5
6struct page; 6struct page;
7struct vm_area_struct;
8struct mm_struct;
7 9
8extern void dump_page(struct page *page, const char *reason); 10extern void dump_page(struct page *page, const char *reason);
9extern void dump_page_badflags(struct page *page, const char *reason, 11extern void dump_page_badflags(struct page *page, const char *reason,
10 unsigned long badflags); 12 unsigned long badflags);
13void dump_vma(const struct vm_area_struct *vma);
14void dump_mm(const struct mm_struct *mm);
11 15
12#ifdef CONFIG_DEBUG_VM 16#ifdef CONFIG_DEBUG_VM
13#define VM_BUG_ON(cond) BUG_ON(cond) 17#define VM_BUG_ON(cond) BUG_ON(cond)
@@ -18,12 +22,28 @@ extern void dump_page_badflags(struct page *page, const char *reason,
18 BUG(); \ 22 BUG(); \
19 } \ 23 } \
20 } while (0) 24 } while (0)
25#define VM_BUG_ON_VMA(cond, vma) \
26 do { \
27 if (unlikely(cond)) { \
28 dump_vma(vma); \
29 BUG(); \
30 } \
31 } while (0)
32#define VM_BUG_ON_MM(cond, mm) \
33 do { \
34 if (unlikely(cond)) { \
35 dump_mm(mm); \
36 BUG(); \
37 } \
38 } while (0)
21#define VM_WARN_ON(cond) WARN_ON(cond) 39#define VM_WARN_ON(cond) WARN_ON(cond)
22#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond) 40#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
23#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format) 41#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
24#else 42#else
25#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) 43#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
26#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) 44#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
45#define VM_BUG_ON_VMA(cond, vma) VM_BUG_ON(cond)
46#define VM_BUG_ON_MM(cond, mm) VM_BUG_ON(cond)
27#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond) 47#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
28#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond) 48#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
29#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond) 49#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)