Breaks cases like
f() {
if (common_case) {
/* handle common case quickly */
return;
}
slow path
critical examples for that is tcp_input.c:tcp_data_queue or parts of
the page fault path in mm/memory.c. You really either need user hints or
profile feedback.
Given some data there are good algorithms in the literature to get a near
perfect jump-less path for the fast paths.
It is definitely worthwhile, for example the Alpha architecture manual makes
it quite clear that even if the probability of a branch being take or not
is only 51:49 moving the less frequent case out-of-line is a win. This is most likely
true for other modern architectures too.
I'm sure which a working __builtin_expect in the kernel that moves blocks
hundreds of gotos could be eliminated from the kernel source :)
-Andi
-- This is like TV. I don't like TV.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/