mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Prarit Bhargava <prarit@redhat.com>
Cc: linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"H. Peter Anvin" <hpa@zytor.com>, Andi Kleen <ak@linux.intel.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Fabian Frederick <fabf@skynet.be>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH] kernel, add bug_on_warn
Date: Mon, 20 Oct 2014 15:24:48 -0700	[thread overview]
Message-ID: <20141020152448.c50fa1855d451f4bba0f6f92@linux-foundation.org> (raw)
In-Reply-To: <1413806420-31828-1-git-send-email-prarit@redhat.com>

On Mon, 20 Oct 2014 08:00:20 -0400 Prarit Bhargava <prarit@redhat.com> wrote:

> There have been several times where I have had to rebuild a kernel to
> cause a panic when hitting a WARN() in the code in order to get a crash
> dump from a system.  Sometimes this is easy to do, other times (such as
> in the case of a remote admin) it is not trivial to send new images to the
> user.
> 
> A much easier method would be a switch to change the WARN() over to a
> BUG().  This makes debugging easier in that I can now test the actual
> image the WARN() was seen on and I do not have to engage in remote
> debugging.
> 
> This patch adds a bug_on_warn kernel parameter, which calls BUG() in the
> warn_slowpath_common() path.  The function will still print out the
> location of the warning.
> 
> Successfully tested by me.

Looks nice and simple and useful.  However I suspect you're exclusively
focussed on "I want a crash dump" and things haven't been fully thought
through.

- Do you have any example WARN->BUG console output at hand?  I'd like
  to check for missing or duplicated info.

- Did you consider permitting this to be tweaked at runtime via
  /proc?  Sometimes we get pesky WARNs at boot time and having runtime
  alteration would permit the user to prevent those from tripping a
  BUG.

- Also, perhaps bug_on_warn should be single-shot: clear itself after
  it has triggered one BUG.  Because once the kernel has gone
  WARN->BUG, it's probably messed up and is likely to trigger more
  WARNs.  Also, the kernel might generate many WARNs for the same
  issue.

> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -553,6 +553,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  	bttv.pll=	See Documentation/video4linux/bttv/Insmod-options
>  	bttv.tuner=
>  
> +	bug_on_warn	BUG() instead of WARN()

There's no mention here that this feature is mainly aimed at generating
a crash dump.  How do we tell the people who aren't reading this email
thread (ie: all of humanity except you and me ;)) that this feature
even exists?  Is there crash dump documentation that we can update?



  reply	other threads:[~2014-10-20 22:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 12:00 Prarit Bhargava
2014-10-20 22:24 ` Andrew Morton [this message]
2014-10-21  0:54   ` Prarit Bhargava
2014-10-21  4:57     ` Yasuaki Ishimatsu

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=20141020152448.c50fa1855d451f4bba0f6f92@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=fabf@skynet.be \
    --cc=hpa@zytor.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=prarit@redhat.com \
    --cc=rusty@rustcorp.com.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome