Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp530522imm; Sat, 1 Sep 2018 10:38:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYJ/MSvXgbyjGg5cnO5/XeJIWivE6Rsa2f7wb2iIbXGA/rUGNcXVzgrHRAOtdS5u64VMFoL X-Received: by 2002:a63:d343:: with SMTP id u3-v6mr14975456pgi.420.1535823529155; Sat, 01 Sep 2018 10:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535823529; cv=none; d=google.com; s=arc-20160816; b=GwqrcmJjnMA7YlysInu+O3wruupufwZA2LcO/cE3tXtprED1OaF+2KtbI3j5ea0vre 2K8wzCVH7+bFe8p//e+Vh9n5gwBuktfJZXElHwjxBjklk12rDI0ohAmTc+8i0qy+2oM+ vKOCBiwH67B0QXcjpWlD8lgRaTdcXh5GDYK/wvrIzHxflcJwd62UVveAuAacunW+1CTb +AhO1m0juZvlc4b1ZaGH1FXhcI46dDm/C91rrKV1qXyPr5RXFlOS+PisI3m75dEuoELB +qm9BptQU+tynEbA2niAkHswX5tTE7DiFs3q7JaXey7O3CxBcbYgTqxV4IrOQw4jZbwx HCeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5wDK53SNPqAHOT0NUGDXNXrZhqCJTfLOD2rdslnNKZM=; b=ekhN9HBbMLoj+6D97f/8kt7yfD9WVS/jrXVqadR/DCtlv6fVkukKVcIKLUzJsFAeqs r2dEyI8QL9NNJN3Ed9j0jvk+Tt/Q0rR+5l54XP0ewht3c2t8KHUzXetu3REzXuCDlisG grCHtm5Gphtr+QEpcVRTFir8Sck6Dt3B59/K2RFwBuWiCmDZhTJNlambf7x3Hk7OvE6a RPaQFedVgHYbpGrXsQGPg4fm1C9OxveKF82eKFu5Ge6iLyQarbr8MjzkkHUL3k/aSbx1 AH5YXt6YvySpZvS1Y39amhSlHCOQGZ2+CAMBQiKRbzfwSWH7Gs3zmhd/VVmdyJARIIuj h4AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dwbmp179; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21-v6si12707145plq.338.2018.09.01.10.38.34; Sat, 01 Sep 2018 10:38:49 -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=@kernel.org header.s=default header.b=dwbmp179; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbeIAVuO (ORCPT + 99 others); Sat, 1 Sep 2018 17:50:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbeIAVuO (ORCPT ); Sat, 1 Sep 2018 17:50:14 -0400 Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B38220846 for ; Sat, 1 Sep 2018 17:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535823450; bh=5379fYm+sbTSYGSMpKbkGcS7eO5TEf4B5fRiOxw/WYs=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=dwbmp179pz/p5wOu4w02BZnQQRd3mJ0Lroyo0Jt+HbBNsTWFFqhYK6igTmLzBM6Jw C2due3pnv9OLGMkH9WopUDeUyTTxDFFCf9RNaAO4rzyuWqfNb2NRAue7+06p1dH32S w0SFpEEQ9yFIs+4zjQp/QY5gaX5tHCoeg9YlcKa0= Received: by mail-wm0-f48.google.com with SMTP id q8-v6so8062952wmq.4 for ; Sat, 01 Sep 2018 10:37:30 -0700 (PDT) X-Gm-Message-State: APzg51CPhMFvPqZd2Po/bJU3DtEmzLHY1wXxfo5oZ2egfg12his1gdCn wDoboOsSTueLOpTZ3mYITtY2sawHTP4Afmye5x5Vog== X-Received: by 2002:a1c:f30d:: with SMTP id q13-v6mr1112392wmq.36.1535823448627; Sat, 01 Sep 2018 10:37:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:9045:0:0:0:0:0 with HTTP; Sat, 1 Sep 2018 10:37:08 -0700 (PDT) In-Reply-To: <0a94774a-6b8b-2014-93e6-131af9c319a6@redhat.com> References: <20180901015935.CCF0B18E20A9@virtux64.softrans.com.au> <0a94774a-6b8b-2014-93e6-131af9c319a6@redhat.com> From: Andy Lutomirski Date: Sat, 1 Sep 2018 10:37:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] x86/vdso: Handle clock_gettime(CLOCK_TAI) in vDSO To: Florian Weimer Cc: Andy Lutomirski , Matt Rickard , Thomas Gleixner , Stephen Boyd , John Stultz , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 1, 2018 at 2:33 AM, Florian Weimer wrote: > On 09/01/2018 05:39 AM, Andy Lutomirski wrote: >> >> Florian, do you think >> glibc would be willing to add some magic to turn >> clock_gettime(CLOCK_MONOTONIC, t) into >> __vdso_clock_gettime_monotonic(t) when CLOCK_MONOTONIC is a constant? > > > What's the goal here? Turn the indirect call/conditional jump/indirect call > sequence into a single indirect call, purely for performance reasons? Almost. It's to bypass some of the branches in __vdso_clock_gettime(), which is supposed to be very fast. AFAIK most user code that uses clock_gettime() passes a constant for the first argument, and we can squeeze out some performance by optimizing that case. The indirect branches internal to the vDSO are a separate issue and should be solved separately. (It's really too bad that x86 doesn't have a 64-bit call instruction. If it did, then the PLT could get rewritten at dynamic link time to avoid indirect calls entirely, and presumably glibc could use the same technique to call into the vDSO without indirect calls.)