Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp526851imm; Wed, 20 Jun 2018 02:16:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIjptJh8t1AOUI/DcQtgwloGQgPgkKk7DWH7PC8/EYFso28Fu8mqF430Cx4/njeUql20oZJ X-Received: by 2002:a65:50cb:: with SMTP id s11-v6mr17582941pgp.384.1529486204784; Wed, 20 Jun 2018 02:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529486204; cv=none; d=google.com; s=arc-20160816; b=hCy+wExABIH0Jj+1b3wVR8mr9q2JPglyQpUTSo7srXIzIppIbHWFEqHAqKPZ/G7Vol Rw0BqH7QFb3Z2NEBP9zYaKdKqE8+MUNE1ZHEDwdzqltmddGgoAPMil6ZRvRAybRRHNYf uPROgxvUh+sL9QNC4LYRCogLqgpBv1LXBz3i5AE6vlkfdPVVgoekf+HJ1otKySzNAZa4 p3zTck0/P4WY4JTmEXZ31ttXOqH4u/aM6e6e0ObasCEWdPKihmqXMsub6brEEeFPkoM6 pv9nDY3SPEnDt2dXf9LFVI/OhV+oBUmUkhkO0sMKYmsZ5dKve40iqc/WYEklhVH6kVV4 1+zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=JFFxQqKJL/axiF2rgD0fif9FN4hU8JRtTGECO2nHdY4=; b=HjEu6cNgbWPP6lAGPdl1YXxX6YsWiBVNDpPYq2jIccV3IlZdNhbZxE/3rMZ+SCblu7 HCOVd8A3qvBlVQqDjVH0zlf0NEd42M8nuTdNW+abEcDYDmAHj7KDHqRphKpEdOFhWRbp YX1qneXM1JWi4N/AwtfNZaT8GzJJ8nhtr5SLZ52h9Uc8v2h7xpHm4YcyJMSMzIlMqx5D 4d8cFsyzWYEFLvxPqtLnCyipWs1jYuN65jd91xpjL8NSI1UmaxST8DhY/wceM+2BuxUh oY4ZQvC2boiOlYAf99H6nxIjw7hfgDlqAncxYT8XWDZcn3MwoiwJcDo7XxnZ6J46WxrM KXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cBXOKv3u; 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 38-v6si2033656plc.446.2018.06.20.02.16.30; Wed, 20 Jun 2018 02:16:44 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cBXOKv3u; 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 S1754846AbeFTJPx (ORCPT + 99 others); Wed, 20 Jun 2018 05:15:53 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57942 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754345AbeFTJPp (ORCPT ); Wed, 20 Jun 2018 05:15:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JFFxQqKJL/axiF2rgD0fif9FN4hU8JRtTGECO2nHdY4=; b=cBXOKv3uhTwhvortJOUZ+8ysV 0Jxpc4bj/qOVHRcQ9kk0/M2VImOIxm08RyhvqqP33LUThDBJWfORWv3tzfsn/UFRnmDfDWd9Yct10 zxgE64Xsw/+TKrYDyb6tZvk1UC83Fjh0c9ZbkdXIOD/vC3SFIcAUnYcowZXM83cHK8wbCGsae+fwf zQxtXRrH6R9k3mpA5/IWZ4+mDzYFzoBfMEkmHAIh1q4mgnDUOq3Ys4eh6+VELaZMDsWrJsVJ92Y3V jjYEV38aUiXv7iQkV5RIoZGVNye9zfjxgq9ZsrP8w3FP/rR6qNVKEBhqj9heMY+WYUb8qoFeksd8+ +nkFDPDmQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVZDC-0007n7-4M; Wed, 20 Jun 2018 09:15:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 25FFC2029F1DD; Wed, 20 Jun 2018 11:15:32 +0200 (CEST) Date: Wed, 20 Jun 2018 11:15:32 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Pavel Tatashin , steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk Subject: Re: [PATCH v10 7/7] x86/tsc: use tsc early Message-ID: <20180620091532.GK2476@hirez.programming.kicks-ass.net> References: <20180615174204.30581-1-pasha.tatashin@oracle.com> <20180615174204.30581-8-pasha.tatashin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 01:52:10AM +0200, Thomas Gleixner wrote: > u64 native_sched_clock(void) > { > + if (static_branch_likely(&__use_tsc)) > + return cycles_2_ns(rdtsc()); > > + if (static_branch_unlikely(&tsc_early_enabled)) { > + if (tsc_early_sched_clock) > + return cycles_2_ns(rdtsc()); > } I'm still puzzled by the entire need for tsc_early_enabled and all that. Esp. since both branches do the exact same thing: return cycles_2_ns(rdtsc());