Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1791669ybl; Sat, 31 Aug 2019 02:19:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaYWfzLWJ1JHqa6DqorgM8nvkVVgHIvf9YvmWheag+nqaRSt9dfQ46pGWjba4UMgCN8OAO X-Received: by 2002:a63:6904:: with SMTP id e4mr12317855pgc.321.1567243192128; Sat, 31 Aug 2019 02:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567243192; cv=none; d=google.com; s=arc-20160816; b=wc3OksjncRNNJQvz+SAKpDr54MsuKPVQojIMwyLewJyYyvSdWUZ+gSXQPGcdB0kiAB t5LeWD4urYN8VITCmra6uia8KLBhjMy1g6bD0pRsETzLzgC/DQqe1hHzEVGycLCB4THx 5H5/T72RofegfikHoKYjDZaMNP5WV+Rj4emr7xZub1vCkjSBV3GLAsFQ1W9bxa/7Mnnn 622ktiThdv4K9ur6wjYio9BcBwb6wrbIvHczlsSXKQIQBqY4dpQAZVgFCQuR4Pb2WFL6 0c1pwOZSXAamofDiZHrijJcO8Q3l8aZv38hvt3vjO61XPgbY3T9o1PVhrBfok9oJ7727 zysg== 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; bh=3eFAuIavvhkkXpaoSObdJRD+mB6l5THOKa3OP4PCgVA=; b=J0DJN2CTO9VlSzWPRaN+jaAl48nfbguFyIeAkRLZkLZybjXXI5hH8uxzCCqwT1V9X8 1NXDLh23x5ULfkHZcfXWLsNI3wt/BvLA9ZwnGv5OKNrSHedwQCrbrW/oeQ0o8CiR7nz1 mzeIuY3w9Yx9IOZ2jHdpbzlZM08sFLHBNtyT9WS2AfCF52VK+3+1HDXzKXwF8d0NTAtF 1oTDN7JjQC34S43inBBGzela6gu2hyLbyNlcP9Rx3hLfOVUEIofmgL405FuYAUohF5IH ido3qtLBL+87IxnZHb9/g0rkukfLx67UvyXuPYZnrghkNeaxuAxubMNgWQ6w3cWc9odH D2eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hlw78MeS; 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 i188si8255559pfe.96.2019.08.31.02.19.37; Sat, 31 Aug 2019 02:19:52 -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=hlw78MeS; 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 S1726811AbfHaJSJ (ORCPT + 99 others); Sat, 31 Aug 2019 05:18:09 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40818 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbfHaJSJ (ORCPT ); Sat, 31 Aug 2019 05:18:09 -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=3eFAuIavvhkkXpaoSObdJRD+mB6l5THOKa3OP4PCgVA=; b=hlw78MeSadjwLy0PloSqG9Ser 9SJyTf8YOUD7Dnt1e/0ENTLCNRIUFnhrKJPDIdo4fX+N8C2P+kbjjXYZEqh2OnoLSF8wJwHLX6pG5 C1xHmeq+irT3+zbK/CB5QMMPPM9D+YLndA+rnQzRo+GJScoEiKPW6CEpRdzzAX1KmZhhtwq0uy2nH vNkLzhNdRS1eGsgCgue3E1oP9pxa9ZVPU843RAMWOrI0XjwWUFsGiV3SlGDWW3cGQ3WvgtxlEuaNQ QrCW6fIpLChDvEFDkm/bV9YQlqbmTE92U1RIF9+vKEc9Q5FOhi4j4nuaYT65n2tqRvNJuvoIoi69t kS6pAstfg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i3zWG-0001jL-NR; Sat, 31 Aug 2019 09:18:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 08733301A76; Sat, 31 Aug 2019 11:17:28 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EF24329B2CD15; Sat, 31 Aug 2019 11:18:02 +0200 (CEST) Date: Sat, 31 Aug 2019 11:18:02 +0200 From: Peter Zijlstra To: "Liang, Kan" Cc: acme@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@kernel.org, eranian@google.com, alexander.shishkin@linux.intel.com, ak@linux.intel.com Subject: Re: [RESEND PATCH V3 3/8] perf/x86/intel: Support hardware TopDown metrics Message-ID: <20190831091802.GI2369@hirez.programming.kicks-ass.net> References: <20190826144740.10163-1-kan.liang@linux.intel.com> <20190826144740.10163-4-kan.liang@linux.intel.com> <20190828151921.GD17205@worktop.programming.kicks-ass.net> <20190829135256.GW2369@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 12:56:02PM -0400, Liang, Kan wrote: > On 8/29/2019 9:52 AM, Peter Zijlstra wrote: > > What what? The PERF_METRICS contents depends on the FIXCTR3 value ?! > > Yes. > > For current implementation, PERF_METRIC MSR is composed by four fields, > backend bound, frontend bound, bad speculation and retiring. > Each of the fields are populated using the below formula for eg: > PERF_METRIC[RETIRING] = (0xFF * > PERF_METRICS_RETIRING_INTERNAL_48bit_COUNTER) > / FIXCTR3 So it really depends on the actual exposed FIXCTR3 _value_ to compute the PERF_METRIC field? *mind boggles*, that's really unspeakable crap. And this isn't documented anywhere afaict. I was thinking they've have an internal counter for the SLOTS value too, so the PERF_METRIC fields are indenpendent; which would be like 'sane'. Exposing the internal counters would've been _soooo_ much better, just add 4 more fixed counters and call it a day. > The METRICS_OVF indicates the overflow of any internal counters. OK, but I'm thinking that by that time the fraction in PERF_METRIC will be too coarse and we're loosing precision. Reconstruction will be inaccurate. > The internal counters only start counting from 0, which cannot be programmed > by SW. But resetting the PERF_METRIC would implicitly resetting the internal > counters. The only possible option given the choices.