Re: [PATCH] Fix a complex race in hrtimer code.

From: Andrew Morton
Date: Mon Oct 11 2010 - 19:24:39 EST


On Mon, 11 Oct 2010 16:18:52 -0700
Salman Qazi <sqazi@xxxxxxxxxx> wrote:

> On Mon, Oct 11, 2010 at 3:43 PM, Andrew Morton
> <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > Poeple are using BUG waaaaay too often.
> >
>
> If people are attentive about WARN_ON_ONCE, then I suppose that is a
> better alternative.
>
> One of the reasons why I personally like BUG_ON is that it catches
> problems early and makes people look (i.e. one can't ignore it, just
> because one didn't notice, understand or care) before it compounds any
> further. It is very hard to debug a corrupted radix tree. It is much
> easier to understand and fix the fact that our assumptions regarding
> the hrtimer state and locking are incorrect.
>
> I'd rather have a BUG_ON firing 100 times, close to the root cause,
> instead of one case of unexplained data corruption far from the root
> cause. Just my $0.02.

You're assuming that you are the one who observes the BUG_ON. In a
large number of cases (probably the majority) it's some random person
on another continent. Their box is dead and after a reboot there's
nothing in the logs. Now what?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/