lkml.org 
[lkml]   [2015]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 1/2] thread_local_abi system call: caching current CPU number (x86)
    > This getcpu cache is an alternative to the sched_getcpu() vdso which has
    > a few benefits:


    Note the first version of getcpu() I proposed had a cache. But it was
    rejected.

    > - It is faster to do a memory read that to call a vDSO,
    > - This cached value can be read from within an inline assembly, which
    > makes it a useful building block for restartable sequences.

    On x86 we already have the de-facto ABI of using LSL with the magic
    segment directly. While that is a few cycles slower than a memory load
    I question the difference is big enough to justify a new system call,
    and risk slow page fault in context switches.

    BTW the vdso could be also optimized I think. For example glibc today
    does some stupid (slow) things with it, like doing double iindirect
    jumps.

    -Andi


    \
     
     \ /
      Last update: 2015-12-13 19:41    [W:2.934 / U:0.904 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site