Messages in this thread | | | From | Andy Lutomirski <> | Date | Fri, 12 Jun 2015 17:09:07 -0700 | Subject | For your amusement: slightly faster syscalls |
| |
The SYSCALL prologue starts with SWAPGS immediately followed by a gs-prefixed instruction. I think this causes a pipeline stall.
If we instead do:
mov %rsp, rsp_scratch(%rip) mov sp0(%rip), %rsp) swapgs ... pushq rsp_scratch(%rip)
then we avoid the stall and save about three cycles.
Horrible horrible code to do this lives here:
https://git.kernel.org/cgit/linux/kernel/git/luto/devel.git/log/?h=x86/faster_syscalls
Caveat emptor: it also disables SMP.
For three cycles, I don't think this is worth trying to clean up.
--Andy
| |