Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1164485

For your amusement: slightly faster syscalls

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject For your amusement: slightly faster syscalls
Date 2015-06-13 02:10 +0200
Message-ID <pAHbj-4H5-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

For your amusement: slightly faster syscalls Andy Lutomirski <luto@amacapital.net> - 2015-06-13 02:10 +0200
  Re: For your amusement: slightly faster syscalls Ingo Molnar <mingo@kernel.org> - 2015-06-18 10:10 +0200

csiph-web