Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1067440imm; Thu, 13 Sep 2018 12:08:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYIeMje9nsRCpOUXxLwQFbU+ZyimqCNGIxn6EN8lNep0NzNfxZbhFU2ZxDi0ryDYKPu6rgf X-Received: by 2002:a63:7107:: with SMTP id m7-v6mr8268752pgc.73.1536865703209; Thu, 13 Sep 2018 12:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536865703; cv=none; d=google.com; s=arc-20160816; b=FmgaaMdGnMeHBmA6sVz9TtClXGUf7EdRXQ4kzU8Rb2fmCRITTGOPxN0l5DW6lnBLyN 4bYTVWW4nJpunHnU1sGju0kS2axkOxgoU/LVSubJSG8jjPKmhI0r7N5gVmduI5DwKYlt x8EgMnwH9IotFdGPlQIU91PLaz+ZO54sPrqnOofgQpqVfvE1Lti2UbNtf02oeaQLLRth RhOTA5nvwjCKL1jb/EGgCuqnWD3D3iDkajxWsyTKntJGFgTLYJ98HNStMe5IwTsWbuIW 7Ca0hZ4lXinjmzX5WuhcMg7VyTwMZcFa6X39yxX+xCgGPwQF438ujJmNB+pSwfQcZ9E2 +GNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=N7ULsEO26lFepciSVRJ3yAu2GtuXfijq5jI+q9U1S8s=; b=OPFDxFA9iQcJFzA+b8pLpQOdhVZlyyFJofzvF4MMYqNcN/l2ZH7WYTRIdIQOo9okTH IyWZZiGyW0fM/vqMXIZ3g2j0xrbbZzTKQbx+hj8xbW75tkpBiZapPoJcWYH47r/Y8bZ3 iXzlsIo8gnJ9IJV+IJh8GfV5qATrh3TxykgckZ7HAs47cnP/cIFbS9iYHhhxAxySn5Qe 0ZgZZEcz5bG3XMawIEu41f5hhXTiZzw8ZDnB4hnOkYIvccSakguc/oCCtfF7S5RYNCpL Nr9HYpDgGJC9BegCy7iczfKrJAXwTFcY5bO0xSMbBmdpmxHh6vDYkLvwsMhwvb7i6HaI R3Nw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si4753400pfd.254.2018.09.13.12.08.05; Thu, 13 Sep 2018 12:08: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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728218AbeINAS2 (ORCPT + 99 others); Thu, 13 Sep 2018 20:18:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34298 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbeINAS2 (ORCPT ); Thu, 13 Sep 2018 20:18:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E905D87625; Thu, 13 Sep 2018 19:07:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19FF95D6AA; Thu, 13 Sep 2018 19:07:37 +0000 (UTC) Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO To: Andy Lutomirski Cc: Thomas Gleixner , Andy Lutomirski , Matt Rickard , Stephen Boyd , John Stultz , X86 ML , LKML References: <20180901015935.CCF0B18E20A9@virtux64.softrans.com.au> <59403142-1073-3926-65dd-ac55ead357b9@redhat.com> <0120ea99-fcac-839a-ef8f-1daa74c17bec@redhat.com> From: Florian Weimer Message-ID: <5f9e890c-fd67-2e39-42ca-64290301b20a@redhat.com> Date: Thu, 13 Sep 2018 21:07:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 13 Sep 2018 19:07:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2018 05:22 PM, Andy Lutomirski wrote: > > >> On Sep 13, 2018, at 1:07 AM, Florian Weimer 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. I suspect most Linux libcs that know about the vDSO at all have generic vsyscall support, just like they have generic support for plain system calls. Thanks, Florian