Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2016979ybl; Thu, 29 Aug 2019 02:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+ZSeJh/0a8VAVegokrz11jhWWgQYPfMn5ptXyf+yPxG6UnrT/bGN1oV5MhACR769rtWvU X-Received: by 2002:a63:3281:: with SMTP id y123mr7204654pgy.72.1567070349010; Thu, 29 Aug 2019 02:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567070349; cv=none; d=google.com; s=arc-20160816; b=KmzE507LFkEwcB1jSuYe6URp25xJEonTVJAqFqUGzeKn4n6QDFeWcJgb2hPMw/Yh0n eZ/26H2byPNQKVZV5YFkXyTrhxN1dfiBKMx5ybYMonXi44B3rZ6rlAf7/qultHD0xMzA ot7I7l9yuPZQBmia3TNJmbeFjIRKxNNffJFOSS8N3+dAp5m8Cu+8+p0xsDUzECmaTUr0 7c8DJGVlL9FmzPSkj+3nq9gBFWs+89qEsv2CfGiCGov+9mVDPYGsktn31pTy/ovUrY6z 4fvzLfj8xwfkrpoY44n7wvL346Leaquag3zK9Gq0T52dpZWjLQf7r1GUr64STZwZs7GZ R/cg== 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=eIzWRNGWJobqw1vcpia7FMnV9L9vEghQ28H7qz8p/sc=; b=uBHc3EBZsoDc/mq68/eAHKc38sEo07Mna9cDguNPwioI23/c5SPtNtZ4vHZVbgFQlN DZI8mk48QWxAG6rm2/OnDZ/kjihM0f9/3+RcDmGVbgdlQYmcEYPHNi3e+J2Gy41bjFqo Y+qc1PYD5WhqRBVoTK9cqaMyP/N1OEH3yOK782rx+nHLrdTXczyoPaYw8GQtm9vGfu46 1dJ13BOyWFNX9Wx2j99ddL2QqoV+01zPoVzn4ZKYoCMUTL9HmEOHf5F6nCDa5Ix07rXG NVzxPMDxw62t9lma6sCSlVxNB70IFfqkN/QPmt6aFWgNSblosWIwn+5t1xCjmRAx8Z8F J92A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Bt0mD2ko; 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 21si1414726pgk.492.2019.08.29.02.18.52; Thu, 29 Aug 2019 02:19:08 -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=Bt0mD2ko; 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 S1727114AbfH2JRX (ORCPT + 99 others); Thu, 29 Aug 2019 05:17:23 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47410 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfH2JRW (ORCPT ); Thu, 29 Aug 2019 05:17:22 -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=eIzWRNGWJobqw1vcpia7FMnV9L9vEghQ28H7qz8p/sc=; b=Bt0mD2koMaJnTwNtUTNfkl2l+ SBYE1pgVGkyFMKwYP7Aq2ba552NQ7+vD/jeUXIK2RyPT9ArG3eHYEM90U/1Y44wpu8UsC1Mqy8w/b j0YsqziOH+0uHqI/NscSslD1loyN+Pnefrhf0aDYA7atnp+ZhMtj1UT8pTNtdgqHX3hoUkYTue1xY WQx78CBsoNJFSF1J2/FgTxVLx6vX4Nop9uppDXYSHomn54Gk6oWxQRgg5MtAXA/OpDq+0gVOzi1UB 4xYabpGbu9DGdpl00ctUe0N1n3HKKlnh0ZC0PYThpfCBYdOM2czRskat1lyoQNA58H3jPjLjrq5FQ JEdUOfFHg==; 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 1i3GYQ-0007Ad-O1; Thu, 29 Aug 2019 09:17:18 +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 98F0E3075FF; Thu, 29 Aug 2019 11:16:42 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C4C1A2022F842; Thu, 29 Aug 2019 11:17:16 +0200 (CEST) Date: Thu, 29 Aug 2019 11:17:16 +0200 From: Peter Zijlstra To: Andi Kleen Cc: kan.liang@linux.intel.com, 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 Subject: Re: [RESEND PATCH V3 3/8] perf/x86/intel: Support hardware TopDown metrics Message-ID: <20190829091716.GO2369@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> <20190828161754.GP5447@tassilo.jf.intel.com> <20190828162857.GO2332@hirez.programming.kicks-ass.net> <20190829031151.GR5447@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829031151.GR5447@tassilo.jf.intel.com> 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 Wed, Aug 28, 2019 at 08:11:51PM -0700, Andi Kleen wrote: > On Wed, Aug 28, 2019 at 06:28:57PM +0200, Peter Zijlstra wrote: > > On Wed, Aug 28, 2019 at 09:17:54AM -0700, Andi Kleen wrote: > > > > This really doesn't make sense to me; if you set FIXED_CTR3 := 0, you'll > > > > never trigger the overflow there; this then seems to suggest the actual > > > > > > The 48bit counter might overflow in a few hours. > > > > Sure; the point is? Kan said it should not be too big; a full 48bit wrap > > around must be too big or nothing is. > > We expect users to avoid making it too big, but we cannot rule it out. > > Actually for the common perf stat for a long time case you can make it fairly > big because the percentages still work out over the complete run time. > > The problem with letting it accumulate too much is mainly if you > want to use a continuously running metrics counter to time smaller > regions by taking deltas, for example using RDPMC. > > In this case the small regions would be too inaccurate after some time. > > But to make the first case work absolutely need to handle the overflow > case. Otherwise the metrics would just randomly stop at some > point. But then you need -max_period, not 0. By using half the period, there is no ambiguity on overflow.