lkml.org 
[lkml]   [2018]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    Subject[patch V2 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support
    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(-)



    \
     
     \ /
      Last update: 2018-09-17 15:10    [W:2.152 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site