linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mingo@kernel.org (Ingo Molnar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH, re-send] Always trap on BUG()
Date: Tue, 23 Jul 2013 11:36:28 +0200	[thread overview]
Message-ID: <20130723093628.GC19786@gmail.com> (raw)
In-Reply-To: <51E47924.9030005@zytor.com>


* H. Peter Anvin <hpa@zytor.com> wrote:

> On 07/15/2013 03:27 PM, Russell King - ARM Linux wrote:
> > On Mon, Jul 15, 2013 at 03:16:12PM -0700, Andrew Morton wrote:
> >> I've been thinking for a while that CONFIG_BUG=n is a pretty dumb thing
> >> to do, and that maintaining it (and trying to fix the warnings it
> >> produces) aren't worth the effort and that we should remove the whole
> >> thing.  Perhaps your patch changes that calculus, dunno.  Please discuss.
> > 
> > This isn't about introducing "CONFIG_BUG=n" - this is about making a
> > kernel with CONFIG_BUG=n build without producing tonnes and tonnes of
> > warnings, as it does today.  It makes building randconfig pretty
> > useless to find what could be more important warnings.
> > 
> 
> Well, there are three alternatives here, right:
> 
> 1. We can use unreachable(), which means that the compiler can assume it
> never happens.

AFAICS this is dangerous as it loses warnings and moves execution into 
la-la-land without any obvious sign at the C level.

> 2. We can trap without metadata.

This is what the patch does.

> 3. We can trap with metadata (current CONFIG_BUG=y).

That is still kept with the patch.

> I am *guessing* this does 2, but it isn't clear.

Yes, that's what it does - and I think it's the best of all worlds:

Acked-by: Ingo Molnar <mingo@kernel.org>

(the crazies can keep a separate patch to remove even more of BUG() to win 
a K or two.)

Thanks,

	Ingo

  parent reply	other threads:[~2013-07-23  9:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05 15:38 [PATCH, re-send] Always trap on BUG() Arnd Bergmann
2013-07-12 10:15 ` Ingo Molnar
2013-07-15 22:16 ` Andrew Morton
2013-07-15 22:27   ` Russell King - ARM Linux
2013-07-15 22:35     ` H. Peter Anvin
2013-07-15 22:47       ` Russell King - ARM Linux
2013-07-23  9:36       ` Ingo Molnar [this message]
2013-07-23  9:54         ` H. Peter Anvin
2013-07-24  0:00         ` Chen Gang
2013-07-25 22:05           ` Ingo Molnar
2013-07-26  1:05             ` Chen Gang

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=20130723093628.GC19786@gmail.com \
    --to=mingo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).