mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	David Daney <ddaney@caviumnetworks.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH 02/10] x86: Convert BUG() to use unreachable()
Date: Fri, 11 Sep 2009 08:07:01 +0200	[thread overview]
Message-ID: <20090911060701.GA18740@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.01.0909101806110.3654@localhost.localdomain>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Thu, 10 Sep 2009, H. Peter Anvin wrote:
> 
> > On 09/10/2009 04:56 PM, David Daney wrote:
> > > Use the new unreachable() macro instead of for(;;);.  When
> > > allyesconfig is built with a GCC-4.5 snapshot on i686 the size of the
> > > text segment is reduced by 3987 bytes (from 6827019 to 6823032).
> > > 
> > > Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> > > CC: Thomas Gleixner <tglx@linutronix.de>
> > > CC: Ingo Molnar <mingo@redhat.com>
> > > CC: "H. Peter Anvin" <hpa@zytor.com>
> > > CC: x86@kernel.org
> > 
> > Acked-by: H. Peter Anvin <hpa@zytor.com>
> > 
> > ... although of course this clashes with Roland McGrath's 
> > patchset for the same thing which I applied earlier.  I have to 
> > say I like unreachable() in lower case better though...
> 
> I like David's version a bit better, since it takes care of more 
> architectures, and also because it avoids that butt-ugly special 
> case for gcc-4.4.1-RH-relase-10 backporting this feature.
> 
> I realize that the RH backport thing is good for testing now, but 
> at the same time, it really does look nasty. I wonder if we could 
> add some config-time compiler feature testing - so that you'd not 
> have a version test at all, but a CONFIG_BUILTIN_UNREACHABLE.
> 
> There are other cases where that kind of config-time testing could 
> be useful, and we could avoid doing various gcc checks dynamically 
> from within 'make' (along with checking for known-buggy versions 
> etc).
> 
> And yeah, it looks better in lower case. That said, I don't care 
> _that_ much, and people can fight it out.

Another detail that would be nice to be fixed is to propagate the 
unreachable() call into the !CONFIG_BUG case as well in 
asm-generic/bug.h.

That would kill dozens of !CONFIG_BUG compiler warnings and would 
make a dont-allow-warnings policy a possibility for random builds.

	Ingo

  parent reply	other threads:[~2009-09-11  6:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4AA991C1.1050800@caviumnetworks.com>
2009-09-10 23:56 ` [PATCH 01/10] Add support for GCC-4.5's __builtin_unreachable() to compiler.h David Daney
2009-09-11  0:14   ` Richard Henderson
2009-09-11 14:32   ` Michael Buesch
2009-09-11 15:58     ` David Daney
2009-09-12  7:22       ` Geert Uytterhoeven
2009-09-14 15:40         ` David Daney
2009-09-10 23:56 ` [PATCH 02/10] x86: Convert BUG() to use unreachable() David Daney
2009-09-11  0:56   ` H. Peter Anvin
2009-09-11  1:09     ` Roland McGrath
2009-09-11  1:13     ` Linus Torvalds
2009-09-11  1:33       ` H. Peter Anvin
2009-09-11  1:37       ` Roland McGrath
2009-09-11  1:42         ` H. Peter Anvin
2009-09-11  6:07       ` Ingo Molnar [this message]
2009-09-11 15:55         ` David Daney
2009-09-13 20:12           ` H. Peter Anvin
2009-09-10 23:56 ` [PATCH 03/10] MIPS: " David Daney
2009-09-10 23:56 ` [PATCH 04/10] s390: " David Daney
2009-09-11 12:18   ` Martin Schwidefsky
2009-09-10 23:56 ` [PATCH 05/10] mn10300: " David Daney
2009-09-10 23:56 ` [PATCH 06/10] parisc: " David Daney
2009-09-28  3:20   ` Kyle McMartin
2009-09-10 23:56 ` [PATCH 07/10] powerpc: " David Daney
2009-09-10 23:56 ` [PATCH 08/10] alpha: " David Daney
2009-09-10 23:56 ` [PATCH 09/10] avr32: " David Daney
2009-09-11  7:31   ` Haavard Skinnemoen
2009-09-10 23:56 ` [PATCH 10/10] blackfin: " David Daney

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=20090911060701.GA18740@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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

Powered by JetHome