mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Florian Weimer <fweimer@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@kernel.org>,
	Matt Rickard <matt@softrans.com.au>,
	Stephen Boyd <sboyd@kernel.org>,
	John Stultz <john.stultz@linaro.org>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO
Date: Thu, 13 Sep 2018 12:35:54 -0700	[thread overview]
Message-ID: <B47AF238-71A6-4FC1-BC5A-55893C2D76B0@amacapital.net> (raw)
In-Reply-To: <5f9e890c-fd67-2e39-42ca-64290301b20a@redhat.com>



> On Sep 13, 2018, at 12:07 PM, Florian Weimer <fweimer@redhat.com> wrote:
> 
> On 09/13/2018 05:22 PM, Andy Lutomirski wrote:
>>> On Sep 13, 2018, at 1:07 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>> 
>>> On 09/12/2018 07:11 PM, Andy Lutomirski wrote:
>>>>> The multiplexer interfaces need much more surgery and talking about futex,
>>>>> we'd need to sit down with quite some people and identify the things they
>>>>> actually care about before just splitting it up and keeping the existing
>>>>> overloaded trainwreck the same.
>>>>> 
>>>> There’s also the issue of how much the speedup matters. For futex, maybe a better interface saves 3ns, but a futex syscall is hundreds of ns. clock_gettime() is called at high frequency and can be ~25ns. Saving a few ns is a bigger deal.
>>> 
>>> My concern is that the userspace system call wrappers currently do not know how many arguments the individual operations take and what types the arguments have (hence the “type-polymorphic” nature I mentioned). This could be a problem for on-stack argument passing (where you might read values beyond the end of the stack, and glibc avoids that most of the time by having enough cruft on the stack), and for architectures which pass pointers and integers in different registers (like some m68k ABIs do for the return value).
> 
>> Isn’t clock_gettime already special because of the vDSO entry point, though?
> 
> Somewhat special, yes, but not overly so, and not in the type-polymorphic sense.  We can't give direct access of the vDSO implementation to applications because the kernel does not know about the userspace errno variable.  We do that for time on x86_64, where applications call into the vDSO directly, bypassing glibc completely after binding.

If the vDSO adds special helpers for CLOCK_MONOTONIC and CLOCK_REALTIME, I think we can reasonably safely promise that they never fail. (seccomp can obviously break that promise if there’s no TSC, but I think that seccomp users who do that get to keep both pieces.)

  reply	other threads:[~2018-09-13 19:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-01  1:59 Matt Rickard
2018-09-01  3:39 ` Andy Lutomirski
2018-09-01  9:33   ` Florian Weimer
2018-09-01 17:37     ` Andy Lutomirski
2018-09-09 20:05   ` Thomas Gleixner
2018-09-10 10:38     ` Thomas Gleixner
2018-09-12 13:01     ` Florian Weimer
2018-09-12 14:17       ` Thomas Gleixner
2018-09-12 14:20         ` Florian Weimer
2018-09-12 14:29           ` Thomas Gleixner
2018-09-12 17:11             ` Andy Lutomirski
2018-09-13  8:07               ` Florian Weimer
2018-09-13 15:22                 ` Andy Lutomirski
2018-09-13 19:07                   ` Florian Weimer
2018-09-13 19:35                     ` Andy Lutomirski [this message]
2018-09-13 19:53                       ` Florian Weimer

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=B47AF238-71A6-4FC1-BC5A-55893C2D76B0@amacapital.net \
    --to=luto@amacapital.net \
    --cc=fweimer@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=matt@softrans.com.au \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®