lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141002141133.B56A6E00A3@blue.fi.intel.com>
Date:	Thu,  2 Oct 2014 17:11:33 +0300 (EEST)
From:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	Dave Hansen <dave.hansen@...el.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] mm: generalize VM_BUG_ON() macros

Andrew Morton wrote:
> On Wed,  1 Oct 2014 14:31:59 +0300 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com> 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?

We had bug like this: lkml.kernel.org/r/53F487EB.7070703@...cle.com where
it's useful to see more than one structure dumped: vma + page in this
case.

We can keep inventing new macros: VM_BUG_ON_PAGE_AND_VM() for the case.
But why not have one to rule them all? ;)

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ