Re: [PATCH] use unlikely() for current_kernel_time() loop

From: Brian F. G. Bidulock
Date: Thu Jun 08 2006 - 03:42:21 EST


Andi,

On Thu, 08 Jun 2006, Andi Kleen wrote:
>
> AFAIK gcc mostly uses the probability information for block reordering
> to make the fast path fall through without jumps.

After a quick try on RH EL4 gcc 3.4.4-2 it appears that
-fno-reorder-blocks indeed defeats __builtin_expect() as you
say. (Which is rather bizarre as __builtin_expect() no longer
does what one expects.) I think that I'm going to strip it out
for my externally compiled modules. Otherwise, the source code
rearrangements necessary to get the same effect will make the
source code unreadable and generate larger code, which I think
is worse than those effects on the assembler code.

Thanks again.

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