Skip to content

Commit fa3759c

Browse files
sashalevintorvalds
authored andcommitted
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>
1 parent 0bf5513 commit fa3759c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎include/linux/mmdebug.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ void dump_vma(const struct vm_area_struct *vma);
2020
BUG(); \
2121
} \
2222
} 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)
2330
#define VM_WARN_ON(cond) WARN_ON(cond)
2431
#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
2532
#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
2633
#else
2734
#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
2835
#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
36+
#define VM_BUG_ON_VMA(cond, vma) VM_BUG_ON(cond)
2937
#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
3038
#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
3139
#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)

0 commit comments

Comments
 (0)