Re: likely/unlikely

From: Adrian Bunk (bunk@fs.tum.de)
Date: Wed Jan 16 2002 - 02:38:56 EST


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/



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:00:15 EST