lkml.org 
[lkml]   [2014]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] Introduce VM_BUG_ON_VMA
On Fri, Aug 29, 2014 at 10:54:18AM -0400, Sasha Levin wrote:
> 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>

> ---
> include/linux/mmdebug.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
> index dfb9333..569e4c8 100644
> --- a/include/linux/mmdebug.h
> +++ b/include/linux/mmdebug.h
> @@ -20,12 +20,20 @@ void dump_vma(const struct vm_area_struct *vma);
> BUG(); \
> } \
> } while (0)
> +#define VM_BUG_ON_VMA(cond, vma) \
> + do { \
> + if (unlikely(cond)) { \
> + dump_vma(vma); \
> + BUG(); \
> + } \
> + } while (0)
> #define VM_WARN_ON(cond) WARN_ON(cond)
> #define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
> #define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
> #else
> #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
> #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
> +#define VM_BUG_ON_VMA(cond, vma) VM_BUG_ON(cond)
> #define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
> #define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
> #define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)
> --
> 1.7.10.4
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>


\
 
 \ /
  Last update: 2014-08-29 21:01    [W:0.190 / U:1.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site