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]
Date:	Fri, 27 Dec 2013 14:26:05 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	"Kirill A. Shutemov" <kirill@...temov.name>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: dump page when hitting a VM_BUG_ON using
 VM_BUG_ON_PAGE

On Fri, 27 Dec 2013 17:19:44 -0500 Sasha Levin <sasha.levin@...cle.com> wrote:

> On 12/27/2013 05:38 AM, Kirill A. Shutemov wrote:
> > On Thu, Dec 26, 2013 at 10:20:52PM -0500, Sasha Levin wrote:
> >> Most of the VM_BUG_ON assertions are performed on a page. Usually, when
> >> one of these assertions fails we'll get a BUG_ON with a call stack and
> >> the registers.
> >>
> >> I've recently noticed based on the requests to add a small piece of code
> >> that dumps the page to various VM_BUG_ON sites that the page dump is quite
> >> useful to people debugging issues in mm.
> >>
> >> This patch adds a VM_BUG_ON_PAGE(cond, page) which beyond doing what
> >> VM_BUG_ON() does, also dumps the page before executing the actual BUG_ON.
> >>
> >> Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
> >
> > I like the idea. One thing I've noticed you have a lot of page flag based
> > asserts, like:
> >
> > 	VM_BUG_ON_PAGE(PageLRU(page), page);
> > 	VM_BUG_ON_PAGE(!PageLocked(page), page);
> >
> > What about adding per-page-flag assert macros, like:
> >
> > 	PageNotLRU_assert(page);
> > 	PageLocked_assert(page);
> >
> > ? This way we will always dump right page on bug.
> >
> 
> Sure, sounds good.
> 
> I'll send another patch on top of this one.

I think I prefer the patch as-is.  To do what Kirill suggests we'd have
to add a heck of a lot more macros and they add little value.  And the
suggested names of those macros aren't very good - there's nothing in
"PageNotLRU_assert" which tells the reader that this code is
conditional on CONFIG_DEBUG_VM, which is a somewhat important thing.
--
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