Skip to content

x86, fpu: kernel_fpu_begin/end initial cleanups/fix

Oleg Nesterov lkml 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 13 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86, fpu: introduce per-cpu "bool in_kernel_fpu"arch/x86/include/asm/i387.h arch/x86/kernel/i387.c+10 -11 reply
1/3x86, fpu: __kernel_fpu_begin() should clear fpu_owner_task even if use_eager_fpu()arch/x86/kernel/i387.c+3 -22 replies
2/3x86, fpu: don't abuse ->has_fpu in __kernel_fpu_{begin,end}()arch/x86/kernel/i387.c+6 -133 replies
2/3x86, fpu: always allow FPU in interrupt if use_eager_fpu()arch/x86/kernel/i387.c+3 -33 replies
3/3x86, fpu: fix math_state_restore() race with kernel_fpu_begin()arch/x86/include/asm/i387.h arch/x86/kernel/i387.c arch/x86/kernel/traps.c+20 -72 replies
3/3x86, fpu: don't abuse FPU in kernel threads if use_eager_fpu()arch/x86/kernel/process.c arch/x86/kernel/xsave.c+8 -122 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchRik van Riel
1/3R-b R-b
1/3R-b R-b
2/3A-b R-b
2/3A-b R-b
3/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] x86, fpu: kernel_fpu_begin/end initial cleanups/fix

Add cc's.

Quoted 6 lines · On 01/11, [email protected] wrote:

Currently the kernel will always load the FPU context, even when switching to a kernel thread, or to an idle thread. In the case of a task on a KVM VCPU going idle for a bit, and waking up again later, this creates a vastly inefficient chain of FPU context saves & loads:

I assume you will send v2.

Let me send initial kernel_fpu_begin/end cleanups, I believe they make sense anyway and won't conflict with your changes.

This is actually resend, I sent more patches some time ago but they were ignored.

Note that (I hope) we can do more changes on top of this series, in particular:

- remove all checks from irq_fpu_usable() except in_kernel_fpu

- do not abuse FPU in kernel threads, this makes sense even if use_eager_fpu(), and with or without the changes you proposed.

Please review.

Oleg.