From: Arnd Bergmann <arnd@arndb.de>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk
Subject: Re: [RFC] asm-generic: default BUG_ON(x) to "if(x) BUG()"
Date: Mon, 23 Nov 2015 22:30:56 +0100 [thread overview]
Message-ID: <4745584.7EJGtZoN8U@wuerfel> (raw)
In-Reply-To: <20151123211748.GA30660@x>
On Monday 23 November 2015 13:17:48 Josh Triplett wrote:
> > not sure where I can find tinyconfig,
>
> "make tinyconfig" in the standard kernel tree. It turns on a few
> options that make the kernel even smaller.
I should learn how that works. We have way too many configuration
files on ARM and it would be nice to use Kconfig fragments to
simplify it a little for things like enabling LPAE or big-endian.
The kernelci.org folks do that already, but it's not in mainline.
FWIW, on tinyconfig, the __modver section remains at 1784 with or
without my patch, and the size difference with my patch applied
is down to 5412 bytes mostly in .text, around 0.50% of the total size.
> > this is what I get for ARM allnoconfig
> > (only totals, let me know if you need more details):
> >
> > original: 961307
> > patched: 969167 (+0.82%)
> > CONFIG_BUG: 994695 (+3.36%)
>
> "patched" here represents allnoconfig with your patch added, but with
> CONFIG_BUG still turned off?
Correct.
> Doesn't seem too bad. Rather large, but I think we ought to fix the
> problem by 1) reducing the number of uses of BUG_ON in the kernel, and
> 2) compiling out more bits of the kernel entirely, including their calls
> to BUG_ON. Eliminating a class of warnings that cause people grief when
> trying to build and contribute to tiny kernels seems worth it, at least
> for now.
Ok
> > > > #ifndef HAVE_ARCH_BUG_ON
> > > > -#define BUG_ON(condition) do { if (condition) ; } while (0)
> > > > +#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
> > >
> > > This makes BUG_ON in the !CONFIG_BUG case almost identical to the
> > > CONFIG_BUG=y case, except for the use of unlikely(condition), which this
> > > ought to do as well.
> > >
> > > Given that, could you pull the definition *out* of the #ifdef/#else for
> > > CONFIG_BUG entirely, and define it the same way in both cases?
> >
> > Yes, I thought about that already and decided to keep the patch simple
> > instead. I can do that of course once we get consensus on the general
> > approach.
>
> Looking at the thread, I think you have it at this point.
>
> And personally I value simplicity of the patched code over simplicity of
> the patch.
Ok, I'll prepare an updated version with that change.
Thanks,
Arnd
next prev parent reply other threads:[~2015-11-23 21:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 16:25 [RFC] asm-generic: default BUG_ON(x) to "if(x) BUG()" Arnd Bergmann
2015-11-23 16:33 ` Willy Tarreau
2015-11-23 16:33 ` Willy Tarreau
2015-11-23 16:37 ` Russell King - ARM Linux
2015-11-23 16:52 ` Willy Tarreau
2015-11-23 16:52 ` Arnd Bergmann
2015-11-23 17:04 ` Willy Tarreau
2015-11-23 17:22 ` Russell King - ARM Linux
2015-11-23 19:29 ` Arnd Bergmann
2015-11-23 19:29 ` Arnd Bergmann
2015-11-23 16:34 ` Russell King - ARM Linux
2015-11-23 20:16 ` Josh Triplett
2015-11-23 20:16 ` Josh Triplett
2015-11-23 20:58 ` Arnd Bergmann
2015-11-23 21:17 ` Josh Triplett
2015-11-23 21:30 ` Arnd Bergmann [this message]
2015-11-23 21:30 ` Arnd Bergmann
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=4745584.7EJGtZoN8U@wuerfel \
--to=arnd@arndb.de \
--cc=josh@joshtriplett.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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