Re: likely/unlikely

Adrian Bunk (bunk@fs.tum.de)
Wed, 16 Jan 2002 08:38:56 +0100 (CET)


On Wed, 16 Jan 2002, Craig Christophel wrote:

> > likely/unlikely set the branch prediction values to 99% or 1%
>
>
> So all of the BUG() routines in the kernel would benifit greatly from this.

In the 2.5 kernels this is done when you use the BUG_ON macro that is
defined as follows:

#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)

BTW: Note that likely/unlikely doesn't has any effect for most of us
because __builtin_expect is only available in gcc >= 2.96.

> Craig.

cu
Adrian

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