From: Andy Lutomirski <luto@amacapital.net>
To: x86@kernel.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Frédéric Weisbecker" <fweisbec@gmail.com>,
"Oleg Nesterov" <oleg@redhat.com>,
"kvm list" <kvm@vger.kernel.org>, "Borislav Petkov" <bp@suse.de>,
"Rik van Riel" <riel@redhat.com>,
"Andy Lutomirski" <luto@amacapital.net>
Subject: [PATCH v2 0/3] x86_64,entry: Rearrange the syscall exit optimizations
Date: Fri, 16 Jan 2015 16:19:26 -0800 [thread overview]
Message-ID: <cover.1421453410.git.luto@amacapital.net> (raw)
Linus, I suspect you'll either like or hate this series. Or maybe
you'll think it's crazy but you'll like it anyway. I'm curious
which of those is the case. :)
The syscall exit asm is a big mess. There's a really fast path, some
kind of fast path code (with a hard-coded optimization for audit), and
the really slow path. The result is that it's very hard to work with
this code. There are some asm paths that are much slower than they
should be (context tracking is a major offender), but no one really
wants to add even more asm to speed them up.
This series takes a different, unorthodox approach. Rather than trying
to avoid entering the very slow iret path, it adds a way back out of the
iret path. The result is a dramatic speedup for context tracking, user
return notification, and similar code, as the cost of a few lines of
tricky asm. Nonetheless, it's barely a net addition of asm code,
because we get to remove the fast path optimizations for audit and
rescheduling.
Thoughts? If this works, it opens the door for a lot of further
consolidation of the exit code.
Note: patch 1 in this series has been floating around on the list
for quite a while. It's mandatory for this series to work, because
the buglet that it fixes almost completely defeats the optimization
that I'm introducing.
Note: Some optimization along these lines is probably certainly needed
to get anything resembling acceptable performance out of the FPU changes
that Rik is working on.
Andy Lutomirski (3):
x86_64,entry: Fix RCX for traced syscalls
x86_64,entry: Use sysret to return to userspace when possible
x86_64,entry: Remove the syscall exit audit and schedule optimizations
arch/x86/kernel/entry_64.S | 109 +++++++++++++++++++++++++--------------------
1 file changed, 61 insertions(+), 48 deletions(-)
--
2.1.0
next reply other threads:[~2015-01-17 0:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 0:19 Andy Lutomirski [this message]
2015-01-17 0:19 ` [PATCH v2 1/3] x86_64,entry: Fix RCX for traced syscalls Andy Lutomirski
2015-01-17 10:13 ` [tip:x86/asm] x86_64 entry: Fix RCX for ptraced syscalls tip-bot for Andy Lutomirski
2015-01-17 0:19 ` [PATCH v2 2/3] x86_64,entry: Use sysret to return to userspace when possible Andy Lutomirski
2015-02-04 6:01 ` [tip:x86/asm] x86_64, entry: " tip-bot for Andy Lutomirski
2015-01-17 0:19 ` [PATCH v2 3/3] x86_64,entry: Remove the syscall exit audit and schedule optimizations Andy Lutomirski
2015-02-04 6:02 ` [tip:x86/asm] x86_64, entry: " tip-bot for Andy Lutomirski
2015-01-17 11:15 ` [PATCH v2 0/3] x86_64,entry: Rearrange the syscall exit optimizations Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1421453410.git.luto@amacapital.net \
--to=luto@amacapital.net \
--cc=bp@suse.de \
--cc=fweisbec@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=riel@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox