[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180912133353.20595-1-bigeasy@linutronix.de>
Date: Wed, 12 Sep 2018 15:33:43 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org, Andy Lutomirski <luto@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
kvm@...r.kernel.org, "Jason A. Donenfeld" <Jason@...c4.com>,
Rik van Riel <riel@...riel.com>
Subject: [RFC PATCH] x86: load FPU registers on return to userland
This is a refurbished series originally started by by Rik van Riel. The
goal is load the FPU registers on return to userland and not on every
context switch. By this optimisation we can:
- avoid loading the registers if the task stays in kernel and does
not return to userland
- make kernel_fpu_begin() cheaper: it only saves the registers on the
first invocation. The second invocation does not need save them again.
To access the FPU registers in kernel we need:
- disable preemption to avoid that the scheduler switches tasks. By
doing so it would set TIF_LOAD_FPU and the FPU registers would be not
valid.
- disable BH because the softirq might use kernel_fpu_begin() and then
set TIF_LOAD_FPU instead loading the FPU registers on completion.
This seems to work with userland & xmm registers. Haven't tested the
pkeys feature and KVM yet.
Sebastian
Powered by blists - more mailing lists