[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CALCETrXUiB9fCRERnKOpcsxmsm44qWw7vnk42j38B4+bJm0=RA@mail.gmail.com>
Date: Fri, 12 Jun 2015 17:09:07 -0700
From: Andy Lutomirski <luto@...capital.net>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
X86 ML <x86@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Denys Vlasenko <vda.linux@...glemail.com>,
Borislav Petkov <bp@...en8.de>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists