All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: Olof Johansson <olof@lixom.net>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch 1/3] move WARN_ON() out of line
Date: Thu, 03 Jan 2008 22:03:13 +0100	[thread overview]
Message-ID: <477D4D91.4010301@linux.intel.com> (raw)
In-Reply-To: <20080103045838.GA25642@lixom.net>

Olof Johansson wrote:
> On Thu, Jan 03, 2008 at 01:56:58AM +0100, Arjan van de Ven wrote:
>> Subject: move WARN_ON() out of line
>> From: Arjan van de Ven <arjan@linux.intel.com>
>> CC: Ingo Molnar <mingo@elte.hu>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>>
>> A quick grep shows that there are currently 1145 instances of WARN_ON
>> in the kernel. Currently, WARN_ON is pretty much entirely inlined,
>> which makes it hard to enhance it without growing the size of the kernel
>> (and getting Andrew unhappy).
>>
>> This patch moves WARN_ON() out of line entirely. I've considered keeping
>> the test inline and moving only the slowpath out of line, but I decided
>> against that: an out of line test reduces the pressure on the CPUs
>> branch predictor logic and gives smaller code, while a function call
>> to a fixed location is quite fast. Likewise I've considered doing something
>> similar to BUG() (eg use a trapping instruction) but that's not really
>> better (it needs the test inline again and recovering from an invalid
>> instruction isn't quite fun).
> 
> Hi Arjan,
> 
> I've got a couple of patches in -mm at the moment that introduces __WARN()
> and uses that (and lets architectures override __WARN, since for example
> powerpc does use trapping instructions similarly to BUG()).
> 
> The two patches in question are:
> 
> bugh-remove-have_arch_bug--have_arch_warn.patch
> powerpc-switch-to-generic-warn_on-bug_on.patch
> 
> Care to do this incrementally on top of that instead? I.e. call
> do_warn_on() from the asm-generic/bug.h __WARN() instead.
> 
> 
ok just did that; will post shortly

  reply	other threads:[~2008-01-03 21:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03  0:56 [patch 1/3] move WARN_ON() out of line Arjan van de Ven
2008-01-03  1:59 ` Matt Mackall
2008-01-03 21:06   ` Arjan van de Ven
2008-01-05  2:35     ` Herbert Xu
2008-01-05 18:33       ` Arjan van de Ven
2008-01-03  4:58 ` Olof Johansson
2008-01-03 21:03   ` Arjan van de Ven [this message]
2008-01-03  9:25 ` Ingo Molnar
2008-01-03 16:22   ` Arjan van de Ven
2008-01-05  6:42   ` Jeremy Fitzhardinge
2008-01-03 11:20 ` Pekka Enberg
2008-01-05  5:09 ` Dmitri Vorobiev
2008-01-05  6:41 ` Jeremy Fitzhardinge
2008-01-05 18:01   ` Arjan van de Ven
2008-01-05 18:08     ` Arjan van de Ven
2008-01-05 18:37       ` Arjan van de Ven
2008-01-05 18:45     ` Jeremy Fitzhardinge
2008-01-05 20:02       ` Arjan van de Ven

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=477D4D91.4010301@linux.intel.com \
    --to=arjan@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=olof@lixom.net \
    /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.