Messages in this thread | | | Date | Wed, 10 Sep 2003 19:31:38 +0100 | From | Jamie Lokier <> | Subject | Re: [PATCH] oops_in_progress is unlikely() |
| |
Richard B. Johnson wrote: > I would guess that the compiler output might be:
Your guess is incorrect.
> You are always going to take an extra jump in one execution > path after the function, and you will take a conditional jump > before the function call in the other execution path. So, you > always have the "extra" jumps, no matter.
That is not true. The "likely" path has no taken jumps.
Think about the code again. How would you optimise it, if you were writing assembly language yourself?
(In more complex examples, another factor is that mis-predicted conditional jumps are much slower than unconditional jumps, so it is good to favour the latter in the likely path).
-- Jamie - 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/
| |