mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: vdso clock_gettime and time64
Date: Wed, 31 Jul 2019 19:11:40 +0200	[thread overview]
Message-ID: <87o91am8mr.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <20190731150725.GB9017@brightrain.aerifal.cx> (Rich Felker's message of "Wed, 31 Jul 2019 11:07:25 -0400")

* Rich Felker:

> On Wed, Jul 31, 2019 at 10:30:26AM +0200, Florian Weimer wrote:
>> * Rich Felker:
>> 
>> > One looming thing that folks probably aren't going to like about
>> > switching to 64-bit time_t is losing the vdso clock_gettime on old
>> > kernels. Instead of a function call in userspace, you get *two*
>> > syscalls, the first (time64) one failing, every time you call
>> > clock_gettime. Of course the problem goes away immediately if you have
>> > a time64-capable kernel providing the time64 vdso function.
>> >
>> > Is this a problem, and if so, what can be done about it?
>> 
>> Some users notice fairly quickly if the vDSO fast path is gone and file
>> bug reports.  (This can happen for various reasons, e.g. buggy kernels
>> detecting CPU cycle counter drift when there is actually none.)  I don't
>> know to what extent this matters to legacy architectures.
>
> These are good points. A lot of these archs actually don't even have
> vdso clock_gettime (only mips, arm, and i386 seem to).
>
> I wonder if it would make sense to support use of 32-bit vdso for now,
> possibly with logic to drop it if it ever returns a negative tv_sec,
> and consider removing it after the last kernel without time64 is
> EOL'd, so that it's gone well before 2038.

In glibc, we perform vDSO lookup early.  I will push for a solution that
does a probing system call during startup if it cannot find the *_time64
vDSO entry, to determine if it should use the real *_time64 system call
or the 32-bit system call (or vDSO).  That should help to keep the
complexity at bay, at the cost of increased startup time, but which will
reduce with future completion of the interfaces.

I do not think resuming a process on a kernel with a different system
call set is supportable.

Thanks,
Florian


  parent reply	other threads:[~2019-07-31 17:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  5:13 Rich Felker
2019-07-31  8:30 ` Florian Weimer
2019-07-31 15:07   ` Rich Felker
2019-07-31 16:47     ` Szabolcs Nagy
2019-08-01  9:16       ` Szabolcs Nagy
2019-07-31 17:11     ` Florian Weimer [this message]
2019-07-31 17:45       ` Rich Felker

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=87o91am8mr.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).