]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - include/linux/mmdebug.h
mm: memcontrol: remove hierarchy restrictions for swappiness and oom_control
[mirror_ubuntu-eoan-kernel.git] / include / linux / mmdebug.h
CommitLineData
59ea7463
JS
1#ifndef LINUX_MM_DEBUG_H
2#define LINUX_MM_DEBUG_H 1
3
309381fe
SL
4struct page;
5
d230dec1
KS
6extern void dump_page(struct page *page, const char *reason);
7extern void dump_page_badflags(struct page *page, const char *reason,
309381fe
SL
8 unsigned long badflags);
9
59ea7463
JS
10#ifdef CONFIG_DEBUG_VM
11#define VM_BUG_ON(cond) BUG_ON(cond)
309381fe
SL
12#define VM_BUG_ON_PAGE(cond, page) \
13 do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0)
02a8efed
AM
14#define VM_WARN_ON(cond) WARN_ON(cond)
15#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
59ea7463 16#else
02602a18 17#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
309381fe 18#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
02a8efed
AM
19#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
20#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
59ea7463
JS
21#endif
22
23#ifdef CONFIG_DEBUG_VIRTUAL
24#define VIRTUAL_BUG_ON(cond) BUG_ON(cond)
25#else
7aa413de 26#define VIRTUAL_BUG_ON(cond) do { } while (0)
59ea7463
JS
27#endif
28
29#endif