Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3059387ybg; Thu, 24 Oct 2019 21:07:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ+Kco8K74Toq6mtDNQXqHo9mpolzij+u0eo/dMQXOwdEILA7R8L3Ex20ZKHatS4DHDzky X-Received: by 2002:a17:906:6d87:: with SMTP id h7mr1511514ejt.4.1571976423327; Thu, 24 Oct 2019 21:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571976423; cv=none; d=google.com; s=arc-20160816; b=zlXlkOUx/11/2i01C+8LlTqZGmtbFKvE1jXST1LKZkzGQ5zhkC80b3i4GWvglYsmj5 E1GamVLXqOw6K1IEEOOji3VJ57Sek6vskMVA3Zv5DHiRLbgbv5APIr+VeqXq/t35yz7I JrsV76YdddujPw45mrlvWA+yfKYFfVx8nd5YiNey/S2hzPp/5jtz01I1vX8lubi4M3DD VRnhooJOWRg5bSSgJK6RSSrz5wUKJ5NEdalcnzXpa8QTPgH33eU+cji9SgHRCBmVEg1S F7+1ZwcnL2aYHE6FLib6yrAC8rg9+abA3QHVp/SqHA8fFwzZXh1P8CeCq+ZR//zKGF+Y 8F1w== 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=0wIgNa4/0iKY7xOQJyVCW0kyYLgPBSeT400KmpY7LkM=; b=wH63LZsYLHD/2+2+RDdP0nt5a0vKN0Pke2bguC65NQhgnu3DmGUg3D20r+fa5fN/ka bxuuosTMrZD2Pi5FoHRUogWbbG96MZrRlZ69CQiS1EG2aj+X9KMAUSU6nQJv6Z2hd3uw 3uorXr+UJ5CmyaVT+bTXHZAo1FUGmxOJSvl2wqWrC2kqzXJPKhEGu9Szwwljdb8W4RCy u2XiLAP6dpJ4mAEt6srIn9XK7YTvfjzYf2eCdNN0NEVKXAspKxGPwXJvglAnSzcaR07k zDcFecoPahfjV5R9D+uvYBhiRqk1JxnF7ih1zi6636KaFP9QfdRPmS/hpmfDykylH0tW DF5g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si455273edk.331.2019.10.24.21.06.38; Thu, 24 Oct 2019 21:07:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438534AbfJXJ2h (ORCPT + 99 others); Thu, 24 Oct 2019 05:28:37 -0400 Received: from foss.arm.com ([217.140.110.172]:44064 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732234AbfJXJ2h (ORCPT ); Thu, 24 Oct 2019 05:28:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4E10B31F; Thu, 24 Oct 2019 02:28:23 -0700 (PDT) Received: from [10.37.9.200] (unknown [10.37.9.200]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EC5843F718; Thu, 24 Oct 2019 02:28:15 -0700 (PDT) Subject: Re: [PATCHv7 18/33] lib/vdso: Add unlikely() hint into vdso_read_begin() To: Andrei Vagin Cc: Dmitry Safonov , linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Adrian Reber , Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org References: <20191011012341.846266-1-dima@arista.com> <20191011012341.846266-19-dima@arista.com> <100f6921-9081-7eb0-7acc-f10cfb647c21@arm.com> <20191024061311.GA4541@gmail.com> From: Vincenzo Frascino Message-ID: <9aa9857e-ee1c-0117-bfcb-45fc6bcab866@arm.com> Date: Thu, 24 Oct 2019 10:30:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024061311.GA4541@gmail.com> Content-Type: text/plain; charset=koi8-r Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrei, On 10/24/19 7:13 AM, Andrei Vagin wrote: > On Wed, Oct 16, 2019 at 12:24:14PM +0100, Vincenzo Frascino wrote: >> On 10/11/19 2:23 AM, Dmitry Safonov wrote: >>> From: Andrei Vagin >>> >>> Place the branch with no concurrent write before contended case. >>> >>> Performance numbers for Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz >>> (more clock_gettime() cycles - the better): >>> | before | after >>> ----------------------------------- >>> | 150252214 | 153242367 >>> | 150301112 | 153324800 >>> | 150392773 | 153125401 >>> | 150373957 | 153399355 >>> | 150303157 | 153489417 >>> | 150365237 | 153494270 >>> ----------------------------------- >>> avg | 150331408 | 153345935 >>> diff % | 2 | 0 >>> ----------------------------------- >>> stdev % | 0.3 | 0.1 >>> >>> Signed-off-by: Andrei Vagin >>> Co-developed-by: Dmitry Safonov >>> Signed-off-by: Dmitry Safonov >> >> Reviewed-by: Vincenzo Frascino >> Tested-by: Vincenzo Frascino > > Hello Vincenzo, > > Could you test the attached patch on aarch64? On x86, it gives about 9% > performance improvement for CLOCK_MONOTONIC and CLOCK_BOOTTIME. > I did run similar tests in past with a previous version of the unified vDSO library and what I can tell based on the results of those is that the impact of "__always_inline" alone was around 7% on arm64, in fact I had a comment stating "To improve performances, in this file, __always_inline it is used for the functions called multiple times." in my implementation [1]. [1] https://bit.ly/2W9zMxB I spent some time yesterday trying to dig out why the approach did not make the cut but I could not infer it from the review process. > Here is my test: > https://github.com/avagin/vdso-perf > > It is calling clock_gettime() in a loop for three seconds and then > reports a number of iterations. > I am happy to run the test on arm64 and provide some results. > Thanks, > Andrei > -- Regards, Vincenzo