public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3, v3] x86/fpu: Remove the thread::fpu pointer
@ 2024-06-05  8:35 Ingo Molnar
  2024-06-05  8:35 ` [PATCH 1/3] x86/fpu: Make task_struct::thread constant size Ingo Molnar
                   ` (3 more replies)
  0 siblings, 4 replies; 30+ messages in thread
From: Ingo Molnar @ 2024-06-05  8:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Andrew Morton, Dave Hansen, Peter Zijlstra,
	Borislav Petkov, H . Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner, Uros Bizjak

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-06-27  3:51 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05  8:35 [PATCH 0/3, v3] x86/fpu: Remove the thread::fpu pointer Ingo Molnar
2024-06-05  8:35 ` [PATCH 1/3] x86/fpu: Make task_struct::thread constant size Ingo Molnar
2024-06-05 19:04   ` Chang S. Bae
2024-06-06  9:30     ` [PATCH] x86/fpu: Fix stale comment in ex_handler_fprestore() Ingo Molnar
2024-06-06 15:55       ` Chang S. Bae
2024-06-05  8:35 ` [PATCH 2/3] x86/fpu: Remove the thread::fpu pointer Ingo Molnar
2024-06-05 13:38   ` Oleg Nesterov
2024-06-06  8:53     ` Ingo Molnar
2024-06-08  6:55       ` Ingo Molnar
2024-06-08  7:26         ` Ingo Molnar
2024-06-08 10:10           ` Oleg Nesterov
2024-06-25  5:26   ` Edgecombe, Rick P
2024-06-25 13:45     ` Edgecombe, Rick P
2024-06-05  8:35 ` [PATCH 3/3] x86/fpu: Remove init_task FPU state dependencies, add debugging warning Ingo Molnar
2024-06-05 14:17   ` Oleg Nesterov
2024-06-05 16:08     ` Linus Torvalds
2024-06-05 16:26       ` Oleg Nesterov
2024-06-05 17:28         ` Linus Torvalds
2024-06-06  8:30           ` [PATCH 3/3, v4] x86/fpu: Remove init_task FPU state dependencies, add debugging warning for PF_KTHREAD tasks Ingo Molnar
2024-06-06  8:46             ` [PATCH 4/3] x86/fpu: Push 'fpu' pointer calculation into the fpu__drop() call Ingo Molnar
2024-06-06  8:47             ` [PATCH 5/3] x86/fpu: Make sure x86_task_fpu() doesn't get called for PF_KTHREAD tasks during exit Ingo Molnar
2024-06-06  8:48             ` [PATCH 3/3, v4] x86/fpu: Remove init_task FPU state dependencies, add debugging warning for PF_KTHREAD tasks Ingo Molnar
2024-06-06 12:00             ` Oleg Nesterov
2024-06-07 10:56               ` Ingo Molnar
2024-06-24  6:47   ` [PATCH 3/3] x86/fpu: Remove init_task FPU state dependencies, add debugging warning Ning, Hongyu
2024-06-27  3:50     ` Ning, Hongyu
2024-06-05 21:21 ` [PATCH 0/3, v3] x86/fpu: Remove the thread::fpu pointer Brian Gerst
2024-06-06  9:06   ` [PATCH] x86/fpu: Introduce the x86_task_fpu() helper method Ingo Molnar
2024-06-06 15:35     ` Brian Gerst
2024-06-07 11:38       ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox