Received: by 10.223.176.46 with SMTP id f43csp1304928wra; Fri, 19 Jan 2018 09:36:09 -0800 (PST) X-Google-Smtp-Source: ACJfBovmSS+arOSg8u6mIl98UuBY1HNo4DWNfd8Qa0ZcLLxUMi8RqzhZ6N2nXhEg1CEFhDWNWotk X-Received: by 10.99.184.17 with SMTP id p17mr41871175pge.357.1516383368901; Fri, 19 Jan 2018 09:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516383368; cv=none; d=google.com; s=arc-20160816; b=fgO4V7SryETC0W6FIWF9CwwGbMDV1kd0jnYJM8ESJx828piveQPc4xVh1uueUagDhl mNZIKcc90vgbGxqKhlHLli8/21qRtb3kuoqEy2oIUPe+fe/57F+9vzC3HFEapjP8xmv2 a8fN8yY0cD6iSINLe/d2BSixak2REVMNn7lctVr+ejD4lfLvfrSRUcO2heoEUnYsic/L qiTV7cMeNJK/OOz6yHDAdBuTfTEclg5xWaQTqXXbh4Eu9afvhAyeX8JaEs1WfgqTkmJz +K/AB+EAnWfXVuTlpK+05gdbR6kRDjT+sAPFrnh2h6L9mNFP4MFM//hSR2PYPHr1I4fq ZptQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Clw0HnCgOwJBDUtMSICfR//mv+9An/4V9+dTcCiaeD4=; b=YmoRDtOot0ZlLtrsmeGTvcL4sj43MK5zepj++jZH6RXOZ5VFdmnMpIwIUe+gFkLcdL DaNBAZA6j0hb7Ofw24uqhejBO7kCE2+aDz7jTvJvkmBGwBxt5lDdDM74361Slu0DripA gr1HWi4txEfxHgpc7BAzXWKj0d9lyZkmpRYcMKlWS46zYZMmNvtZo6P0P6GT8MTrZb8r XrxTiQ7JT1lA6VMiq7le6AaFQVHcR7FUl7+bcZh1eo75N4I4EZ5mvwrwQaE8ggwh7bGR B1Nwt2E6bZj65NlyWaSBjmFg25MV11sxHJthGGgGpcsTaQG34ny8dPOaLSddIBYwaLn3 NXlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jDf+5ZJ/; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si8523838pgc.166.2018.01.19.09.35.54; Fri, 19 Jan 2018 09:36:08 -0800 (PST) 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=pass header.i=@google.com header.s=20161025 header.b=jDf+5ZJ/; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932657AbeASRfE (ORCPT + 99 others); Fri, 19 Jan 2018 12:35:04 -0500 Received: from mail-it0-f44.google.com ([209.85.214.44]:44291 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932631AbeASRew (ORCPT ); Fri, 19 Jan 2018 12:34:52 -0500 Received: by mail-it0-f44.google.com with SMTP id b5so2990258itc.3 for ; Fri, 19 Jan 2018 09:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Clw0HnCgOwJBDUtMSICfR//mv+9An/4V9+dTcCiaeD4=; b=jDf+5ZJ/blavpB/IAXjFQZqw2jwkSSEfC/qqLcUn1BJWKqmeiauvfrWN5CqZU4IpTl VfbPw8pbVDpJnJE41Nn9f27IH2sCUTYFQBhBQUkfkU6+D/IyI+2dvFImuzEyDXPngdKn wRxNgLjbE7cFpjrNYHI/TY1IymC6TgiRyJ0aaTzuP0i6qiELM28sNwUdQFhj2WqiGreD jTt0pzpOkTbiI3mgK0OPtDiDAzYERuWPCjNiXYJnLfXKdra0qq2Q/OUObKkBiE8Ax6T0 UvnPFK0cgEzSmoumEVynOQyHyiq897CS+mGhdQrbVxQmVXo7DvdddiGXnOHXKhhEjOeP dbdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Clw0HnCgOwJBDUtMSICfR//mv+9An/4V9+dTcCiaeD4=; b=WzuGCDFm1kP7fCgEo2o3GeiYAYkxqhAqdKT43vPCOd1909g/tEWtdmckcqPJ2JIT39 ffdR+rAA1a+BWl+hbJGmrod0Goam2UhDKuj9jh8TxaodZKshv82iqBRBx5zBdtuYNHij JITsNvY3G6Bv2rUtaYW0KmEYGQYZXgHv5PCXhloWFsiEOR7CVdGx+ujZup4tMhleU8jd DJ02xCkl26Q7sxYYDtXLBqIOw/B/hlq3d4rg6EJ8sphL3kO1ijYDht6PyHTtW/yPozpq dtCfDPFRFb1uUILLyr3kJPsQY5g/3zXQ1Jz/pLBRV04hvAY/v1veueaA9TqxVHmEdYcQ +RGQ== X-Gm-Message-State: AKwxyteQOWutlR+SlyyleW+O4fLpKKqWRlYr4/U2SXA4kDv7j2sGbAVD RGt77aapKYgB5XsNlLL+yYZjYBpXhbaVJCJivuUGPQ== X-Received: by 10.36.77.65 with SMTP id l62mr34203597itb.42.1516383291245; Fri, 19 Jan 2018 09:34:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.170.39 with HTTP; Fri, 19 Jan 2018 09:34:50 -0800 (PST) In-Reply-To: <20180119171929.GZ2228@hirez.programming.kicks-ass.net> References: <1516042629-387021-1-git-send-email-kan.liang@intel.com> <1516042629-387021-4-git-send-email-kan.liang@intel.com> <20180118133248.GC2249@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F07753801FEF@SHSMSX103.ccr.corp.intel.com> <20180119130731.GQ2228@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F077538025E7@SHSMSX103.ccr.corp.intel.com> <20180119171929.GZ2228@hirez.programming.kicks-ass.net> From: Stephane Eranian Date: Fri, 19 Jan 2018 09:34:50 -0800 Message-ID: Subject: Re: [PATCH V5 4/8] perf/x86/intel/uncore: add new data structures for free running counters To: Peter Zijlstra Cc: "Liang, Kan" , "tglx@linutronix.de" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "ak@linux.intel.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 9:19 AM, Peter Zijlstra wrote: > > On Fri, Jan 19, 2018 at 03:15:00PM +0000, Liang, Kan wrote: > > > > > > On Thu, Jan 18, 2018 at 05:43:10PM +0000, Liang, Kan wrote: > > > > In the uncore document, there is no event-code assigned to free running > > > counters. > > > > Some events need to be defined to indicate the free running counters. > > > > The events are encoded as event-code + umask-code. > > > > > > > > The event-code for all free running counters is 0xff, which is the > > > > same as the fixed counters. > > > > > > Is it possible to count the same things using the generic counters? > > > > > > > Yes, there are events for generic counters to count bandwidth and > > utilization. > > > > The reasons of introducing free running counters are > > - To provide highly valuable information (bandwidth and utilization) > > which most of the customers are interested in > > - To save on the precious generic counters > > _IF_ the exact same counters are available on the GPs then we must use the > same event code for them and use event scheduling to place them on > fixed/free-running counters when possible. > > That's what we do for the CPU PMU's fixed counters too. > > Don't invent magic event codes just because. I agree with Peter here. The scheduling algorithm should take care of this. There is only one case in the core PMU where we had to invent an event code. That was for UNHALTED_REFERENCE_CYCLES which could only be measured on a fixed counters. But for the other two, the scheduling code takes care of them taking into consideration filter bits.