From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] nohz: Make tick_nohz_irq_exit() irq safe
Date: Fri, 22 Feb 2013 09:54:38 +0100 [thread overview]
Message-ID: <20130222085438.GA29144@gmail.com> (raw)
In-Reply-To: <CA+55aFwj0bVS0H1YBMq9EHbkYrU7-so8S6onCKs2M1Q+g4AmNA@mail.gmail.com>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Thu, Feb 21, 2013 at 10:21 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > This was a draft patch. I made it a WARN_ON_ONCE() already.
>
> Ok, good.
>
> I really wish we could just get rid of BUG_ON(). It was a bad
> idea, and it makes it easy for people to do the wrong thing.
> Sadly, we have tons of them.
So my old plan was to use a little bit of psychology.
Firstly, we could just turn BUG_ON() into a WARN() variant that
emits:
BUG: ...
while a WARN()ings emit:
WARNING: ...
and then we could introduce a new primitive:
CRASH_ON();
which would be used in the (few) places that really, really
cannot continue sanely and need to crash the box.
This naming alone would inhibit its use through two channels:
- Putting the word 'CRASH' into your code feels risky,
dissonant and wrong (perfect code does not crash) and thus
needs conscious frontal lobe effort to justify it - while
BUG_ON() really feels more like a harmless assert to most
kernel developers, which is in our muscle memory through
years training.
- CRASH_ON() takes one character more typing than WARN_ON(),
and we know good kernel developers are fundamentally lazy.
[ This is an arguably lazy plan that does not involve changing
the 10,000+ BUG_ON() call sites and does not involve the
re-training of thousands of mis-trained kernel developers who
introduced over 900 new BUG_ON()s in the v3.7->v3.8 cycle
alone (!). ]
So while I don't think we can win the war against BUG_ON(), I
think we can fight the lazy general's war: turn the enemy over
to our side and declare victory?
Thanks,
Ingo
next prev parent reply other threads:[~2013-02-22 8:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1361373336-11337-1-git-send-email-fweisbec@gmail.com>
2013-02-20 21:00 ` [PATCH] nohz: Make tick_nohz_irq_exit() irq safe Thomas Gleixner
2013-02-20 22:01 ` Frederic Weisbecker
2013-02-20 23:15 ` Thomas Gleixner
2013-02-21 16:13 ` Frederic Weisbecker
2013-02-21 16:46 ` Thomas Gleixner
2013-02-21 16:49 ` Frederic Weisbecker
2013-02-21 17:45 ` [tip:irq/urgent] irq: Ensure irq_exit() code runs with interrupts disabled tip-bot for Thomas Gleixner
2013-02-21 19:48 ` Frederic Weisbecker
2013-02-21 19:51 ` Thomas Gleixner
2013-02-21 17:46 ` [tip:irq/urgent] irq: Sanitize invoke_softirq tip-bot for Thomas Gleixner
2013-02-21 17:53 ` [PATCH] nohz: Make tick_nohz_irq_exit() irq safe Linus Torvalds
2013-02-21 18:21 ` Thomas Gleixner
2013-02-21 18:28 ` Linus Torvalds
2013-02-22 8:54 ` Ingo Molnar [this message]
2013-02-21 20:05 ` [tip:irq/urgent] irq: Ensure irq_exit() code runs with interrupts disabled tip-bot for Thomas Gleixner
2013-02-21 20:07 ` [tip:irq/urgent] irq: Sanitize invoke_softirq tip-bot for Thomas Gleixner
2013-02-21 17:43 ` [tip:irq/urgent] nohz: Make tick_nohz_irq_exit() irq safe tip-bot for Frederic Weisbecker
2013-02-21 20:04 ` tip-bot for Frederic Weisbecker
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=20130222085438.GA29144@gmail.com \
--to=mingo@kernel.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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