public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Bruno Haible <bruno@clisp.org>, Paul Eggert <eggert@cs.ucla.edu>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH] time: Use CLOCK_REALTIME for time (BZ #30200)
Date: Wed, 8 Mar 2023 14:46:08 -0300	[thread overview]
Message-ID: <50d01e1c-1a6d-87fa-35ed-165682c773b8@linaro.org> (raw)
In-Reply-To: <87mt4nqiek.fsf@oldenburg.str.redhat.com>



On 08/03/23 14:09, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>> On 08/03/23 13:23, Bruno Haible wrote:
>>> Paul Eggert wrote:
>>>> My idea is to go through the apps I help maintain, and make sure that 
>>>> they never call 'time' anywhere that it's important that a timestamp be 
>>>> in sync with with the rest of the system
>>>
>>> Alternatively, these applications can continue to call 'time', if the
>>> package uses the Gnulib module 'time' that provides a workaround against
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=30200 .
>>>
>>> Bruno
>>
>> Florian, do you really think that and latency increase of roughly 15ns 
>> is really worth all the trouble gnulib is pushing? It means that we will 
>> end up with programs that use CLOCK_REALTIME, while other use 
>> CLOCK_REALTIME_COURSE.  
>>
>> If users really to squeeze more performance, they can use clock_gettime
>> with CLOCK_REALTIME_COURSE.  It should have similar performance to
>> time vDSO.
> 
> Eh, I think the difference derives from using the time vDSO entrypoint
> (which your patch removed as well on x86-64).  I don't see a performance
> difference between CLOCK_REALTIME and CLOCK_REALTIME_COARSE, so that's
> not it.

I just did some benchmarks using vdso test with time vdso support [1]

$ ./vdsotest clock-gettime-realtime bench
clock-gettime-realtime: syscall: 82 nsec/call
clock-gettime-realtime:    libc: 18 nsec/call
clock-gettime-realtime:    vdso: 18 nsec/call

$ ./vdsotest clock-gettime-realtime-coarse bench
clock-gettime-realtime-coarse: syscall: 65 nsec/call
clock-gettime-realtime-coarse:    libc: 5 nsec/call
clock-gettime-realtime-coarse:    vdso: 3 nsec/call

$ ./vdsotest time bench
time: syscall: 41 nsec/call
time:    libc: 2 nsec/call
time:    vdso: 1 nsec/call

So while time vdso still show small improvement, I hardly think it is a 
dealbreaker. 

[1] git@github.com:zatrazz/vdsotest.git

  reply	other threads:[~2023-03-08 17:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 16:03 Adhemerval Zanella
2023-03-07 11:11 ` Florian Weimer
2023-03-07 11:45   ` Adhemerval Zanella Netto
2023-03-07 11:51     ` Florian Weimer
2023-03-07 11:57       ` Adhemerval Zanella Netto
2023-03-07 12:07         ` Florian Weimer
2023-03-08  5:51           ` Paul Eggert
2023-03-08  8:59             ` Florian Weimer
2023-03-08 23:08               ` Paul Eggert
2023-03-08 16:23             ` Bruno Haible
2023-03-08 16:57               ` Adhemerval Zanella Netto
2023-03-08 17:09                 ` Florian Weimer
2023-03-08 17:46                   ` Adhemerval Zanella Netto [this message]
2023-03-08 17:44                 ` Bruno Haible
2023-03-08 17:50                   ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50d01e1c-1a6d-87fa-35ed-165682c773b8@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=bruno@clisp.org \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).