Re: [PATCH 1/3] mm: generalize VM_BUG_ON() macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed,  1 Oct 2014 14:31:59 +0300 "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> This patch makes VM_BUG_ON() to accept one to three arguments after the
> condition. Any of these arguments can be page, vma or mm. VM_BUG_ON()
> will dump info about the argument using appropriate dump_* function.
> 
> It's intended to replace separate VM_BUG_ON_PAGE(), VM_BUG_ON_VMA(),
> VM_BUG_ON_MM() and allows additional use-cases like:
> 
>   VM_BUG_ON(cond, vma, page);
>   VM_BUG_ON(cond, vma, src_page, dst_page);
>   VM_BUG_ON(cond, mm, src_vma, dst_vma);
>   ...

I can't say I'm a fan of this.  We don't do this sort of thing anywhere
else in the kernel and passing different types to the same thing in
different places is unusual and exceptional.  We gain very little from
this so why bother?

Adding new printk(%p) thingies for vmas and pages would be more
consistent but still of dubious value.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]