Skip to content

x86/process: Optimize __switch_to_extra()

Thomas Gleixner lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/process: Optimize TIF checks in switch_to_extra()arch/x86/kernel/process.c+31 -234 replies
2/3x86/process: Optimize TIF_BLOCKSTEP switcharch/x86/include/asm/processor.h arch/x86/kernel/process.c+14 -83 replies
3/3x86/process: Optimize TIF_NOTSC switcharch/x86/include/asm/tlbflush.h arch/x86/kernel/process.c+14 -183 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [patch 0/3] x86/process: Optimize __switch_to_extra()

GCC generates lousy code in __switch_to_extra(). Aside of that some of the operations there are implemented suboptimal.

This series, inspired by a patch from Kyle, helps the compiler to be less stupid by explicitely giving the hints to optimize and replaces the open coded bit toggle mechanisms with proper helper functions.

The resulting change in text size:

	 64bit	    32bit

Before: 3726 9388
After: 3646 9324
Delta: 80 152

The number of conditional jumps is also reduced:

	 64bit	    32bit

Before: 8 13
After: 5 10

Thanks,

tglx

---
 include/asm/processor.h |   12 ++++++++
 include/asm/tlbflush.h  |   10 ++++++
 kernel/process.c        |   70 +++++++++++++++++++-----------------------------
 3 files changed, 51 insertions(+), 41 deletions(-)