Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1714650ybl; Wed, 28 Aug 2019 20:13:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3Wi9niycwhfpUHQcWmQgW//GoVRr9yON9EryN7UmxXmEN4RUjdXHkBo3Y5RUPHBDQS/gC X-Received: by 2002:a62:28c:: with SMTP id 134mr8746180pfc.194.1567048437541; Wed, 28 Aug 2019 20:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567048437; cv=none; d=google.com; s=arc-20160816; b=gOb3ydDsukspsoTjGBw9xTfsFd71U4JxRcVqepuxdmqdtDKlfUuSRE35YVQtmUuvoH Z1vEDFWRQcEtYilSF/fqrdrf84Nl0wMyyKLlww5470rZGiwZvnrXcFXGVs9ovMzMm7yQ Hx34dFhbV9cyzvNpooIt32Yjfk/nhtcwX/fyITwVygEenkUje2xL8McQW51ibWHdOcLS PhEpcukbyo5QWxl2cxdBLPvNG8em+loklaJeOyUrI3+mtu6TpcJB+L1YP4HnQgWq+bKk uOF0lFHptzSUSYMMfEZOep61AG/w2Sl7kLpNzbz2B2OT+0KJrO2lYYiLRKoNmQayh9Xp chiw== 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; bh=3Y6bGKQ/8S2e2NM8dNT/vjbqP4TENIkN32hyfIUr0nI=; b=sB1dzd4DTpPXXXO4H7Ol32viA/qglKVBY691h7iwSXHxbblNh7+sADC7zUlO1R0sDQ lXykwgZapxbFHo9ATWKFW5enSNwlN65ZUsbtlb2J1PyV3QKGl+hJXuCIy6Rf4KcgjjCZ QHAvuZ2p4KUmVPmqbmhknLW85799vJXEn+kSMWWwvVmgErMedbAAru7gYlMXBG3QB7dG IKkKXZb3C0YkpkyMNti30Z9wCQUIGdDUVFeeK/Ze56R3weCH6J5/1XqC6ExJ7i/sYQUm Ehpv8p6bzavKXnovzs5h+3CfGPoiP3jqR9CIT/Sb+FR5G2DXH3ZS6GyIn4IgCu91fY91 oBmg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si766959pgu.376.2019.08.28.20.13.29; Wed, 28 Aug 2019 20:13:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbfH2DLw (ORCPT + 99 others); Wed, 28 Aug 2019 23:11:52 -0400 Received: from mga14.intel.com ([192.55.52.115]:1407 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfH2DLw (ORCPT ); Wed, 28 Aug 2019 23:11:52 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2019 20:11:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,442,1559545200"; d="scan'208";a="182212723" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by fmsmga007.fm.intel.com with ESMTP; 28 Aug 2019 20:11:52 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id DE41C301004; Wed, 28 Aug 2019 20:11:51 -0700 (PDT) Date: Wed, 28 Aug 2019 20:11:51 -0700 From: Andi Kleen To: Peter Zijlstra 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: <20190829031151.GR5447@tassilo.jf.intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828162857.GO2332@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.12.0 (2019-05-25) 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 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. -Andi