All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch V2 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support
@ 2018-09-17 12:45 Thomas Gleixner
  2018-09-17 12:45 ` [patch V2 01/11] clocksource: Provide clocksource_arch_init() Thomas Gleixner
                   ` (21 more replies)
  0 siblings, 22 replies; 36+ messages in thread
From: Thomas Gleixner @ 2018-09-17 12:45 UTC (permalink / raw)
  To: LKML
  Cc: Andy Lutomirski, x86, Peter Zijlstra, Matt Rickard, Stephen Boyd,
	John Stultz, Florian Weimer, K. Y. Srinivasan, Vitaly Kuznetsov,
	devel, virtualization, Paolo Bonzini, Arnd Bergmann,
	Juergen Gross

Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime()
implementation, which extended the clockid switch case and added yet
another slightly different copy of the same code.

Especially the extended switch case is problematic as the compiler tends to
generate a jump table which then requires to use retpolines. If jump tables
are disabled it adds yet another conditional to the existing maze.

This series takes a different approach by consolidating the almost
identical functions into one implementation for high resolution clocks and
one for the coarse grained clock ids by storing the base data for each
clock id in an array which is indexed by the clock id.

This completely eliminates the switch case and allows further
simplifications of the code base, which at the end all together gain a few
cycles performance or at least stay on par with todays code. The resulting
performance depends heavily on the micro architecture and the compiler.

Changes vs. V1:

  - Fix the VCLOCK_MAX sanity check
  - Remove the magic clock masking and extend the storage array

Thanks,

        tglx

8<-------------------
 arch/x86/Kconfig                        |    1 
 arch/x86/entry/vdso/vclock_gettime.c    |  199 ++++++++------------------------
 arch/x86/entry/vsyscall/vsyscall_gtod.c |   55 ++++----
 arch/x86/include/asm/vgtod.h            |   42 +++---
 arch/x86/kernel/time.c                  |   22 +++
 include/linux/clocksource.h             |    5 
 kernel/time/Kconfig                     |    4 
 kernel/time/clocksource.c               |    2 
 8 files changed, 140 insertions(+), 190 deletions(-)




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

end of thread, other threads:[~2018-10-04 21:10 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 12:45 [patch V2 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support Thomas Gleixner
2018-09-17 12:45 ` [patch V2 01/11] clocksource: Provide clocksource_arch_init() Thomas Gleixner
2018-09-17 20:05   ` John Stultz
2018-10-04 21:03   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 01/11] " Thomas Gleixner
2018-09-17 12:45 ` [patch V2 02/11] x86/time: Implement clocksource_arch_init() Thomas Gleixner
2018-09-17 12:45 ` Thomas Gleixner
2018-10-04 21:04   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 03/11] x86/vdso: Enforce 64bit clocksource Thomas Gleixner
2018-09-17 12:45 ` Thomas Gleixner
2018-10-04 21:05   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 04/11] x86/vdso: Use unsigned int consistently for vsyscall_gtod_data::seq Thomas Gleixner
2018-10-04 21:05   ` [tip:x86/vdso] x86/vdso: Use unsigned int consistently for vsyscall_gtod_data:: Seq tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 04/11] x86/vdso: Use unsigned int consistently for vsyscall_gtod_data::seq Thomas Gleixner
2018-09-17 12:45 ` [patch V2 05/11] x86/vdso: Introduce and use vgtod_ts Thomas Gleixner
2018-09-17 12:45 ` Thomas Gleixner
2018-10-04 21:06   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 06/11] x86/vdso: Collapse high resolution functions Thomas Gleixner
2018-10-04 21:06   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 06/11] " Thomas Gleixner
2018-09-17 12:45 ` [patch V2 07/11] x86/vdso: Collapse coarse functions Thomas Gleixner
2018-10-04 21:07   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 07/11] " Thomas Gleixner
2018-09-17 12:45 ` [patch V2 08/11] x86/vdso: Replace the clockid switch case Thomas Gleixner
2018-10-04 21:07   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 08/11] " Thomas Gleixner
2018-09-17 12:45 ` [patch V2 09/11] x86/vdso: Simplify the invalid vclock case Thomas Gleixner
2018-10-04 21:08   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 09/11] " Thomas Gleixner
2018-09-17 12:45 ` [patch V2 10/11] x86/vdso: Move cycle_last handling into the caller Thomas Gleixner
2018-09-17 12:45 ` Thomas Gleixner
2018-10-04 21:09   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 11/11] x66/vdso: Add CLOCK_TAI support Thomas Gleixner
2018-09-30  2:56   ` Matthew Rickard
2018-10-04 21:09   ` [tip:x86/vdso] " tip-bot for Thomas Gleixner
2018-09-17 12:45 ` [patch V2 11/11] " Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.