[lkml]   [2011]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH v4 0/6] Micro-optimize vclock_gettime
    On Tue, May 17, 2011 at 6:59 PM, Thomas Gleixner <> wrote:
    > On Tue, 17 May 2011, Andi Kleen wrote:
    >> Andy Lutomirski <luto@MIT.EDU> writes:
    >> >
    >> > On KVM on Sandy Bridge, I can emulate a vsyscall that does nothing in 400ns or so.  I'll try to make this code emulate real vsyscalls over the weekend.  This was much easier than I expected.
    >> How about the performance of all the statically linked programs? I guess
    > _ALL_ the statically linked programs? Point out a single one which
    > matters and _IS_ performance critical.
    >> you just declared they don't matter? gettimeofday is quite critical
    >> and adding a exception into it is just a performance desaster.
    >> Also it's always a dangerous assumption to think that all
    >> programs on Linux use glibc ("all world is a Vax")
    >> In fact more and more of Linux users are using different libcs these
    >> days (like Android or embedded systems or languages with special runtime
    >> systems) Who knows if all those other libraries use vDSO?
    > Which is completely irrelevant to x86_64. Point to a single relevant
    > x86_64 embedded system to which one of the above handwaving applies.
    >> And then there are of course the old glibcs. A lot of people
    >> (including me) use new kernels with old userland.
    > And how is your use case performance critical ?
    > Furthermore any halfways up to date deployemnt is using VDSO for
    > obvious reasons and the archaic stuff which might be affected is not
    > using a recent kernel at all (except for akpm on his retro laptop, but
    > that "performance penalty" is probably the least of his worries).

    Sadly that's not quite true. glibc git right now contains this:

    ENTRY (__gettimeofday)
    /* Align stack. */
    sub $0x8, %rsp
    #ifdef SHARED
    movq __vdso_gettimeofday(%rip), %rax
    PTR_DEMANGLE (%rax)
    movq $VSYSCALL_ADDR_vgettimeofday, %rax
    callq *%rax

    And time() and sched_getcpu() call the vsyscall page unconditionally.
    We should either declare CLOCK_REALTIME_COARSE to be acceptable for
    time() or add a new vDSO call.

    IMO we should put a note in feature-removal-schedule.txt, add vsyscall
    emulation as a config option for 2.6.41 but leave it turned off by
    default, and turn it on by default (or just remove the old code) in
    2.6.43 or so. That'll give glibc a chance to stop generating *new*
    static binaries that call it.

    I'm not volunteering to dig around the libdl stuff to fix it myself.

    klibc doesn't seem to use vsyscalls or the vDSO. I haven't looked at
    uclibc, and I don't think that Bionic has any released version on

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2011-05-18 05:21    [W:0.026 / U:12.748 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site