Re: [PATCH 3/4] x86: open-code register save/restore in trace_hardirqs thunks

From: Linus Torvalds
Date: Sat Jan 10 2015 - 16:08:41 EST


On Sat, Jan 10, 2015 at 12:17 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
>
> I asked this once, and someone told me that push/pop has lower
> throughput. I find this surprising.

It was true for some AMD CPU's in particular. One insn/cycle vs two.

I personally would be very happy to go back to push/pop sequences.
Even without a fancy stack engine like Intel has done for a while,
even *simple* cores can generally pair pushes and pops. I think the
original Pentium already had a special magic pairing logic to pair
pushes and pops despite both instructions using %esp. It's a common
and fairly trivial special case, and the fact that a few AMD
microarchitectures didn't do it is likely not really a good reason to
avoid repeated push/pop instructions.

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