Skip to content

x86/fpu: Remove the thread::fpu pointer

Ingo Molnar lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 20 repliesIn review
  2. v11 patch 5 repliesApplied

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/fpu: Make task_struct::thread constant sizearch/x86/include/asm/fpu/sched.h arch/x86/include/asm/processor.h arch/x86/kernel/fpu/context.h +14 more+99 -1028 replies
2/3x86/fpu: Remove the thread::fpu pointerarch/x86/include/asm/fpu/sched.h arch/x86/include/asm/processor.h arch/x86/kernel/fpu/context.h +14 more+70 -727 replies
3/3x86/fpu: Remove init_task FPU state dependencies, add debugging warningarch/x86/include/asm/processor.h arch/x86/kernel/fpu/core.c arch/x86/kernel/fpu/init.c +2 more+16 -1412 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH 0/3, v3] x86/fpu: Remove the thread::fpu pointer

This series is one of the dependencies of the fast-headers work, which aims to reduce header complexity by removing <asm/processor.h> from the <linux/sched.h> dependency chain, which headers are headers are fat enough already even if we do not combine them.

To achieve that decoupling, one of the key steps is to not embedd any C types from <asm/processor.h> into task_struct.

The only architecture that relies on that in a serious fashion is x86, via 'struct thread::fpu', and the series below attempts to resolve it by using a calculated &task->thread.fpu value via the x86_task_fpu() helper.

Code generation: without CONFIG_X86_DEBUG_FPU=y we get a small reduction:

   text        data        bss        dec         hex        filename
   26475783    10439082    1740804    38655669    24dd6b5    vmlinux.before
   26475601    10435146    1740804    38651551    24dc69f    vmlinux.after

With the new debug code - which I think we'll remove soon-ish, there's an expected increase:

   text        data        bss        dec         hex        filename
   26476198    10439286    1740804    38656288    24dd920    vmlinux.CONFIG_X86_DEBUG_FPU.before
   26477000    10435458    1740804    38653262    24dcd4e    vmlinux.CONFIG_X86_DEBUG_FPU.after

The Git tree can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/fpu

Thanks,

Ingo

===============>
Ingo Molnar (3):
x86/fpu: Make task_struct::thread constant size
x86/fpu: Remove the thread::fpu pointer
x86/fpu: Remove init_task FPU state dependencies, add debugging warning

 arch/x86/include/asm/fpu/sched.h |  2 +-
 arch/x86/include/asm/processor.h | 19 ++++++++++---------
 arch/x86/kernel/fpu/context.h    |  4 ++--
 arch/x86/kernel/fpu/core.c       | 57 +++++++++++++++++++++++++++++++--------------------------
 arch/x86/kernel/fpu/init.c       | 23 +++++++++++++----------
 arch/x86/kernel/fpu/regset.c     | 22 +++++++++++-----------
 arch/x86/kernel/fpu/signal.c     | 18 +++++++++---------
 arch/x86/kernel/fpu/xstate.c     | 23 ++++++++++-------------
 arch/x86/kernel/fpu/xstate.h     |  6 +++---
 arch/x86/kernel/process.c        |  6 ++----
 arch/x86/kernel/signal.c         |  6 +++---
 arch/x86/kernel/traps.c          |  2 +-
 arch/x86/math-emu/fpu_aux.c      |  2 +-
 arch/x86/math-emu/fpu_entry.c    |  4 ++--
 arch/x86/math-emu/fpu_system.h   |  2 +-
 arch/x86/mm/extable.c            |  2 +-
 include/linux/sched.h            | 13 +++----------
 17 files changed, 104 insertions(+), 107 deletions(-)
Signature · 1 line
2.43.0