[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrW-LkeBUJ6zw7a30mCV2T0Pd5mjYMHjLptg1voTq0VUdA@mail.gmail.com>
Date: Sat, 1 Sep 2018 10:37:08 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Florian Weimer <fweimer@...hat.com>
Cc: Andy Lutomirski <luto@...nel.org>,
Matt Rickard <matt@...trans.com.au>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>,
John Stultz <john.stultz@...aro.org>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO
On Sat, Sep 1, 2018 at 2:33 AM, Florian Weimer <fweimer@...hat.com> wrote:
> On 09/01/2018 05:39 AM, Andy Lutomirski wrote:
>>
>> Florian, do you think
>> glibc would be willing to add some magic to turn
>> clock_gettime(CLOCK_MONOTONIC, t) into
>> __vdso_clock_gettime_monotonic(t) when CLOCK_MONOTONIC is a constant?
>
>
> What's the goal here? Turn the indirect call/conditional jump/indirect call
> sequence into a single indirect call, purely for performance reasons?
Almost. It's to bypass some of the branches in
__vdso_clock_gettime(), which is supposed to be very fast. AFAIK most
user code that uses clock_gettime() passes a constant for the first
argument, and we can squeeze out some performance by optimizing that
case. The indirect branches internal to the vDSO are a separate issue
and should be solved separately.
(It's really too bad that x86 doesn't have a 64-bit call instruction.
If it did, then the PLT could get rewritten at dynamic link time to
avoid indirect calls entirely, and presumably glibc could use the same
technique to call into the vDSO without indirect calls.)
Powered by blists - more mailing lists