Re: [announce] [patch] Voluntary Kernel Preemption Patch

From: Takashi Iwai
Date: Mon Jul 12 2004 - 05:27:54 EST


At Sat, 10 Jul 2004 02:52:08 +0200,
Andrea Arcangeli wrote:
>
> On Sat, Jul 10, 2004 at 01:50:17AM +0200, Andrea Arcangeli wrote:
> > agreed. might_sleep() just like BUG() can be defined to noop.
>
> BTW, this reminded me a related topic that I can't recall being ever
> mentioned on l-k: BUG_ON can also be optimized away. So people should be
> careful not to do write this:
>
> BUG_ON(test_and_set_bit(p))
>
> but to write this instead:
>
> if (unlikely(test_and_set_bit(p))
> BUG()

Couldn't it be simply written like below?

#define BUILD_BUG_ON(condition) do { if (unlikely(condition)) BUILD_BUG(); } while(0)



Takashi
-
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/