Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1098884imm; Thu, 13 Sep 2018 12:39:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYCLL2ymkH345hRBZLXrr0wlQ8vZBMlx2aZYOkDSdCoKz+RR/QORB+FISFrtkS71MiSwyhl X-Received: by 2002:a63:5904:: with SMTP id n4-v6mr8465191pgb.134.1536867563179; Thu, 13 Sep 2018 12:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536867563; cv=none; d=google.com; s=arc-20160816; b=v05dSQOLw7/14TtSSzqHQE7d3+LY/iLDk3j7C3/eK7Um0NqnjdfopNCTMPITDHJkL5 H5Ka8973NVpxkkVsw5+rGICKflqTrsbZ5zRlMTUy7Soyf7J61PglmwH+h5UXr2XMpipS blO9EdZJ4RKbA2xXooVuKHmXjjMFUkXZcTWCUFATL9ZYlj7LLsgKyRMo+irLfxakOHyN soQGtdC7jrWyueWyR49GlQTBgVxnt14UWXlfWHa2UCCSwOARftiuL1oZmsb+mmkIh7kq cC5kwVo3uQ40/ZvqalYz0/wncRDRwdeu7HfHTPSMgULxXFWWKuohaXcejLa/iWR+D6q6 G3oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=rsL/qQZd3OZcI4R0N70mfkuBXhbCop6r+N1Z8XkdT0E=; b=s6JmY5RrJIGlBALa/0b3ABbFI0LNZc8k4LXMk3LhUx3O4u/WUKqNXIqN4ocrCyJ/xb gdm2rPpurqnRyzNmipcDiz18I2Hm3gVyMUjguRcN/KoyyWhWPEN7ogh/vbBFEa5fesbP iHOeyIbGnGBfdxjcJm2OWbrheWyPtuvZcJDuXoqDgrH58hdVjyVTRTzMmrh4jwcoM26+ e3JDOve25ZZv20gaCDgqQIZRl2Wy6yJiysR3t6Wx4p6TdBs9nLG7XH8SJgPgqg+E01FE r1wHoVcZUobCzdLU4cQjOIkvaPlEG7O4JcH+mdFJaS6Ur671GXGo13HDj3T3UGpOxeGc 8rHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=0EdeSMS1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14-v6si4612131plp.371.2018.09.13.12.39.08; Thu, 13 Sep 2018 12:39:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=0EdeSMS1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbeINAqy (ORCPT + 99 others); Thu, 13 Sep 2018 20:46:54 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41495 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbeINAqx (ORCPT ); Thu, 13 Sep 2018 20:46:53 -0400 Received: by mail-pf1-f196.google.com with SMTP id h79-v6so3125636pfk.8 for ; Thu, 13 Sep 2018 12:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rsL/qQZd3OZcI4R0N70mfkuBXhbCop6r+N1Z8XkdT0E=; b=0EdeSMS1pc78klaQN6i+TTBBWIEPwI5jogqzzhHXdf+ai7l+BAmHggD/1a2L2g+k9Q oXeBhIN0Av+k6qij/FTbPNK04n2ftzOdgjLiR0BRGBH6PG+TqhpUfvTjfFnl07PezG3K 0ZgiIjPF41MHpo2iTVE/wWUBz+yy2iQr3dUlS6z6c+0sm/tyqXPgy/OCX8Hs6RBrDNT8 +AK+Q5jSw2pw4pj3brU7rO6Av7FjOjWRRKtYso2B86tGfmop1otuZmNckRmIkW/t/vV3 Vw7InuFRRwOnHKeIrebJIsPrioJXZlrz82g1HPe7+s2O9jvW3g43R/r7fVTuE0+cVuxR +LoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rsL/qQZd3OZcI4R0N70mfkuBXhbCop6r+N1Z8XkdT0E=; b=m60KpwdfbehsgCR3kfdAtUmC3LA2ltro2nz4jgMTzJdp9cQb7/3k6MRcSJAjOl9dAu J54YRR67gYIC3ru5otGNPNOwNKKATNHofConVVHBMx/lnG14Hm25QflYGGW2f9r9ruFm m5q1DlaKTIgx25TvBU1TXNrWGnNwPVjZ95Ti8NEXgID6VBib2JmNAzQ3r9B5ASY14S77 KV9sLCsyPsrSONdBrAJUHziXq2Obiakj/p1vgOlszxgNOhG4IGUwoPJyBPdJMcCwULQD Z32nlAeZY5dbeAg6XMcTR9EUy20lBEMFJtX40l17FD9pNJRELsYGeT4jkfDuGDLDX4RM p6FA== X-Gm-Message-State: APzg51AW+Pc7l9fnVTEn9h6w7GJThtZtO64VVkXcSMNpBJMzdOejcbjX WbMwVpqPMTUgv4ZmzoBJVYeZ3g== X-Received: by 2002:a63:4826:: with SMTP id v38-v6mr8483446pga.379.1536867358085; Thu, 13 Sep 2018 12:35:58 -0700 (PDT) Received: from ?IPv6:2600:1010:b010:5d82:811e:589c:a336:e7f4? ([2600:1010:b010:5d82:811e:589c:a336:e7f4]) by smtp.gmail.com with ESMTPSA id r64-v6sm6564350pfk.157.2018.09.13.12.35.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 12:35:56 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO From: Andy Lutomirski X-Mailer: iPhone Mail (15G77) In-Reply-To: <5f9e890c-fd67-2e39-42ca-64290301b20a@redhat.com> Date: Thu, 13 Sep 2018 12:35:54 -0700 Cc: Thomas Gleixner , Andy Lutomirski , Matt Rickard , Stephen Boyd , John Stultz , X86 ML , LKML Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180901015935.CCF0B18E20A9@virtux64.softrans.com.au> <59403142-1073-3926-65dd-ac55ead357b9@redhat.com> <0120ea99-fcac-839a-ef8f-1daa74c17bec@redhat.com> <5f9e890c-fd67-2e39-42ca-64290301b20a@redhat.com> To: Florian Weimer Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 13, 2018, at 12:07 PM, Florian Weimer wrote: >=20 > On 09/13/2018 05:22 PM, Andy Lutomirski wrote: >>> On Sep 13, 2018, at 1:07 AM, Florian Weimer wrote: >>>=20 >>> On 09/12/2018 07:11 PM, Andy Lutomirski wrote: >>>>> The multiplexer interfaces need much more surgery and talking about fu= tex, >>>>> we'd need to sit down with quite some people and identify the things t= hey >>>>> actually care about before just splitting it up and keeping the existi= ng >>>>> overloaded trainwreck the same. >>>>>=20 >>>> There=E2=80=99s also the issue of how much the speedup matters. For fut= ex, maybe a better interface saves 3ns, but a futex syscall is hundreds of n= s. clock_gettime() is called at high frequency and can be ~25ns. Saving a fe= w ns is a bigger deal. >>>=20 >>> My concern is that the userspace system call wrappers currently do not k= now how many arguments the individual operations take and what types the arg= uments have (hence the =E2=80=9Ctype-polymorphic=E2=80=9D nature I mentioned= ). This could be a problem for on-stack argument passing (where you might re= ad values beyond the end of the stack, and glibc avoids that most of the tim= e by having enough cruft on the stack), and for architectures which pass poi= nters and integers in different registers (like some m68k ABIs do for the re= turn value). >=20 >> Isn=E2=80=99t clock_gettime already special because of the vDSO entry poi= nt, though? >=20 > Somewhat special, yes, but not overly so, and not in the type-polymorphic s= ense. We can't give direct access of the vDSO implementation to application= s because the kernel does not know about the userspace errno variable. We d= o that for time on x86_64, where applications call into the vDSO directly, b= ypassing glibc completely after binding. If the vDSO adds special helpers for CLOCK_MONOTONIC and CLOCK_REALTIME, I t= hink we can reasonably safely promise that they never fail. (seccomp can obv= iously break that promise if there=E2=80=99s no TSC, but I think that seccom= p users who do that get to keep both pieces.)