public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	eike-kernel@sf-tec.de, rth@twiddle.net, torvalds@osdl.org
Subject: Re: [2.6 patch] if ... BUG() -> BUG_ON()
Date: Thu, 15 Jan 2004 10:20:48 +1100	[thread overview]
Message-ID: <20040115102048.4689664e.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20040113213230.GY9677@fs.tum.de>

On Tue, 13 Jan 2004 22:32:30 +0100
Adrian Bunk <bunk@fs.tum.de> wrote:

> Hi Andrew,
> 
> four months ago, Rolf Eike Beer <eike-kernel@sf-tec.de> sent a patch 
> against 2.6.0-test5-bk1 that converted several if ... BUG() to BUG_ON()
> (this might in some cases result in slightly faster code).

You know, I dislike this.

The right fix is to hack gcc to allow functions (in this case, BUG()) to have
an "unlikely" attribute, and therefore know that this branch is unlikely.

Making code slightly less readable for minor (and hopefully temporary)
optimizations is IMHO not a worthy use of your time.

Quick!  To the GCC sources!  Run!
Rusty.
-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

  reply	other threads:[~2004-01-15  1:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 21:32 [2.6 patch] if ... BUG() -> BUG_ON() Adrian Bunk
2004-01-14 23:20 ` Rusty Russell [this message]
2004-01-15  5:05   ` Richard Henderson
2004-01-15 22:46   ` Anton Blanchard

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=20040115102048.4689664e.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@osdl.org \
    --cc=bunk@fs.tum.de \
    --cc=eike-kernel@sf-tec.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --cc=torvalds@osdl.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