aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2014-10-09 18:28:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:25:57 -0400
commitfa3759ccd5651c4235f572302d58c8ec9ddf1c4b (patch)
tree99817626e8a972624a1d178d1595ff7a7e527827
parent0bf55139782db1fa96af66e37cc84afde18443ef (diff)
mm: introduce VM_BUG_ON_VMA
Very similar to VM_BUG_ON_PAGE but dumps VMA information instead. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mmdebug.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index dfb93333fc62..569e4c8d0ebb 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -20,12 +20,20 @@ void dump_vma(const struct vm_area_struct *vma);
20 BUG(); \ 20 BUG(); \
21 } \ 21 } \
22 } while (0) 22 } while (0)
23#define VM_BUG_ON_VMA(cond, vma) \
24 do { \
25 if (unlikely(cond)) { \
26 dump_vma(vma); \
27 BUG(); \
28 } \
29 } while (0)
23#define VM_WARN_ON(cond) WARN_ON(cond) 30#define VM_WARN_ON(cond) WARN_ON(cond)
24#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond) 31#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
25#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format) 32#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
26#else 33#else
27#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) 34#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
28#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) 35#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
36#define VM_BUG_ON_VMA(cond, vma) VM_BUG_ON(cond)
29#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond) 37#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
30#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond) 38#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
31#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond) 39#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)