All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Gavin Guo <gavin.guo@canonical.com>, stable@vger.kernel.org
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [backport v3.12 PATCH 1/3] mm: pass VM_BUG_ON() reason to dump_page()
Date: Fri, 13 May 2016 14:54:05 +0200	[thread overview]
Message-ID: <5735CE6D.800@suse.cz> (raw)
In-Reply-To: <1462851799-17773-2-git-send-email-gavin.guo@canonical.com>

On 05/10/2016, 05:43 AM, Gavin Guo wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> commit e4f674229ce63dac60be0c4ddfb5ef8d1225d30d upstream
> 
> I recently added a patch to let folks pass a "reason" string dump_page()
> which gets dumped out along with the page's data.  This essentially
> saves the bug-reader a trip in to the source to figure out why we
> BUG_ON()'d.
> 
> The new VM_BUG_ON_PAGE() passes in NULL for "reason".  It seems like we
> might as well pass the BUG_ON() condition if we have it.  This will
> bloat kernels a bit with ~160 new strings, but this is all under a
> debugging option anyway.
> 
> 	page:ffffea0008560280 count:1 mapcount:0 mapping:(null) index:0x0
> 	page flags: 0xbfffc0000000001(locked)
> 	page dumped because: VM_BUG_ON_PAGE(PageLocked(page))
> 	------------[ cut here ]------------
> 	kernel BUG at /home/davehans/linux.git/mm/filemap.c:464!
> 	invalid opcode: 0000 [#1] SMP
> 	CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.0+ #251
> 	Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
> 	...
> 
> [akpm@linux-foundation.org: include stringify.h]
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Acked-by: Davidlohr Bueso <davidlohr@hp.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> [fixes the conflict and includes the VM_BUG_ON_PAGE]
> Signed-off-by: Gavin Guo <gavin.guo@canonical.com>
> ---
>  include/linux/mmdebug.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
> index 580bd587d916..fa387ca7218c 100644
> --- a/include/linux/mmdebug.h
> +++ b/include/linux/mmdebug.h
> @@ -1,10 +1,19 @@
>  #ifndef LINUX_MM_DEBUG_H
>  #define LINUX_MM_DEBUG_H 1
>  
> +#include <linux/stringify.h>
>  #ifdef CONFIG_DEBUG_VM
>  #define VM_BUG_ON(cond) BUG_ON(cond)
> +#define VM_BUG_ON_PAGE(cond, page)					\
> +	do {								\
> +		if (unlikely(cond)) {					\
> +			dump_page(page, "VM_BUG_ON_PAGE(" __stringify(cond)")");\

But dump_page in 3.12 accepts only one parameter.

And this is not the commit which actually added VM_BUG_ON_PAGE. The one
which did, included also dump_page prototype in this header.

Instead, I would just change VM_BUG_ON_PAGE to VM_BUG_ON in the second
patch.

thanks,
-- 
js
suse labs

  reply	other threads:[~2016-05-13 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  3:43 [backport v3.12 PATCH 0/3] Avoid out of bounds access in isolate_migratepages_range Gavin Guo
2016-05-10  3:43 ` [backport v3.12 PATCH 1/3] mm: pass VM_BUG_ON() reason to dump_page() Gavin Guo
2016-05-13 12:54   ` Jiri Slaby [this message]
2016-05-10  3:43 ` [backport v3.12 PATCH 2/3] mm/balloon_compaction: redesign ballooned pages management Gavin Guo
2016-05-10  3:43 ` [backport v3.12 PATCH 3/3] mm/balloon_compaction: fix deflation when compaction is disabled Gavin Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5735CE6D.800@suse.cz \
    --to=jslaby@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=gavin.guo@canonical.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.