Re: [PATCH v2 3/3] i387: support lazy restore of FPU state

From: Linus Torvalds
Date: Tue Feb 21 2012 - 13:26:49 EST


On Tue, Feb 21, 2012 at 9:59 AM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> I don't know if unlazy_fpu() being out of line will cause a context
> switch performance loss, though.

unlazy_fpu() is no longer used for context switching - it's only used
for unlazying the FPU.

Part of the whole FP mess is that there were all these *insane*
dependencies where these things were used for different semantic
issues. That's largely fixed now, and things have a single semantic
use.

> Acked-by: H. Peter Anvin <hpa@xxxxxxxxx>
>
> Let me know if you'd prefer me to pull this into the -tip tree.

Yes, but I'll send you this with a proper commit log. I'll also send
you another patch that splits "<asm/i387.h>" into two.

Right now <asm/i387.h> has two different users: the first of which
"normal kernel use" kind of things (ie kernel_fpu_begin() and friends)
that really don't care about the internals very deeply. But the second
class of user is the actual i387 internal implementation thing that is
used by i387.c and xsave.c etc to actually implement the exposed
interfaces.

As a result, <asm/i387.h> is this mixture of exposed interfaces and
"deep internal knowledge". And as a result, that deep internal
knowledge kind of accidentally gets exposed to code that really
shouldn't be exposed to it.

I have a patch that fixes that. I'll send you a series of two patches
with sign-offs and commentary asap.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/