Re: [RFC] gcc feature request: Moving blocks into sections

Linus Torvalds
2013-08-05T17:15:18Z

On Mon, Aug 5, 2013 at 10:12 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Secondly, you don't want a separate section anyway for any normal
> kernel code, since you want short jumps if possible

Just to clarify: the short jump is important regardless of how
unlikely the code you're jumping is, since even if you'd be jumping to
very unlikely ("never executed") code, the branch to that code is
itself in the hot path.

And the difference between a two-byte short jump to the end of a short
function, and a five-byte long jump (to pick the x86 case) is quite
noticeable.

Other cases do long jumps by jumping to a thunk, and so the "hot case"
is unaffected, but at least one common architecture very much sees the
difference in the likely code.

Linus