From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F185C2BA83 for ; Fri, 14 Feb 2020 12:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08D09222C2 for ; Fri, 14 Feb 2020 12:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729080AbgBNMAB (ORCPT ); Fri, 14 Feb 2020 07:00:01 -0500 Received: from foss.arm.com ([217.140.110.172]:60402 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbgBNMAA (ORCPT ); Fri, 14 Feb 2020 07:00:00 -0500 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 8C5941FB; Fri, 14 Feb 2020 03:59:59 -0800 (PST) Received: from [192.168.1.18] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED1E93F68F; Fri, 14 Feb 2020 03:59:56 -0800 (PST) Subject: Re: [patch V2 01/17] x86/vdso: Mark the TSC clocksource path likely To: Thomas Gleixner , LKML Cc: x86@kernel.org, John Stultz , Andy Lutomirski , Christophe Leroy , Paolo Bonzini , Juergen Gross , Michael Kelley , Sasha Levin , Ralf Baechle , Paul Burton , James Hogan , Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Andrei Vagin References: <20200207123847.339896630@linutronix.de> <20200207124402.328922847@linutronix.de> From: Vincenzo Frascino Message-ID: <31f89a71-d64b-28af-69a6-656c016a53df@arm.com> Date: Fri, 14 Feb 2020 12:00:04 +0000 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: <20200207124402.328922847@linutronix.de> Content-Type: text/plain; charset=utf-8 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 On 2/7/20 12:38 PM, Thomas Gleixner wrote: > Jumping out of line for the TSC clcoksource read is creating awful > code. TSC is likely to be the clocksource at least on bare metal and the PV > interfaces are sufficiently more work that the jump over the TSC read is > just in the noise. > Reviewed-by: Vincenzo Frascino > Signed-off-by: Thomas Gleixner > --- > arch/x86/include/asm/vdso/gettimeofday.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/arch/x86/include/asm/vdso/gettimeofday.h > +++ b/arch/x86/include/asm/vdso/gettimeofday.h > @@ -243,7 +243,7 @@ static u64 vread_hvclock(void) > > static inline u64 __arch_get_hw_counter(s32 clock_mode) > { > - if (clock_mode == VCLOCK_TSC) > + if (likely(clock_mode == VCLOCK_TSC)) > return (u64)rdtsc_ordered(); > /* > * For any memory-mapped vclock type, we need to make sure that gcc > -- Regards, Vincenzo