Received: by 10.223.176.46 with SMTP id f43csp1493536wra; Fri, 19 Jan 2018 12:20:15 -0800 (PST) X-Google-Smtp-Source: ACJfBos5HooP4DrV0xjWdQeFc/uOnPFe4QZ+zLPMhofqz2eNiODyEP+E61T/uZo1zoxKtFNjvy48 X-Received: by 10.99.113.11 with SMTP id m11mr32646674pgc.57.1516393215329; Fri, 19 Jan 2018 12:20:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516393215; cv=none; d=google.com; s=arc-20160816; b=Xtn0abcPCDsOMKZDUutk6OPPT7SbfGb1liTaW8LBH0xbN8wslZ5sf+wJAmVTL81JmN wPqgc182bgd62bepfEFtlR4mx9U1MCcFqustClQQfMXYuXzeXrbj6PPUsRcNGi7J+yTv VKVB/S7oAhMUhGRWjQDNcgPCLW3uatjiAC6x9YwN3KyfVJ8R1LFk4Fdzi504VARNOQMn OcI/MYe6YlH6gg5jHgg1GByuz/KshhGtGctNrOf7P0bmZ+CZXTmoXuJy8AyimDNV99Bp qOXOlMhSzLeRllr2Fbbu0rLFr2m8g5kule3mAtgAUw8JaDdAWQjWzBmgAY5SI0QK7lAJ LmaQ== 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=2l0plHDgWkgySaTRp2Zwjkk0Efdfjn8xt8+ZDFjL9ak=; b=a0rTFlrOt3tz8vReEn5OfxmAvRPZjtXPa9xdwcCZxyNxBeFand/TKQeDKDmjqKlub+ m9J7gfhLk6JslHWRW8UPAJc4SHKH/Ks0z+d05tgyqDbpyDrnlfBuo6ZhhTaihzKnNf+6 s4y8aw5YFe4kZJg3P7lsTI5aLgH2H7vRGNeBN71S9Cy5d7QJcjU/fguYHpRnYAu9/sAX C/jMRFCatd9LtdzF0k6E+Ep9//wBoutVjIc0YdsfaMODc3Fb9boU7JmmXWVNByfjXmT1 RqAJzj395qEGCJQfTM3QSqbqflvWhOpnzGsZlgQinryeD0vBDFrfsYvfm+AS9WAl5Hun vt/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lEKuL3A+; 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 y34-v6si1067982plb.403.2018.01.19.12.19.58; Fri, 19 Jan 2018 12:20:15 -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=lEKuL3A+; 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 S1756420AbeASUS5 (ORCPT + 99 others); Fri, 19 Jan 2018 15:18:57 -0500 Received: from mail-io0-f172.google.com ([209.85.223.172]:37108 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756176AbeASUSw (ORCPT ); Fri, 19 Jan 2018 15:18:52 -0500 Received: by mail-io0-f172.google.com with SMTP id f89so3433588ioj.4 for ; Fri, 19 Jan 2018 12:18:51 -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=2l0plHDgWkgySaTRp2Zwjkk0Efdfjn8xt8+ZDFjL9ak=; b=lEKuL3A+ZcptMqyQxG06LZnuzUxsu5cqJ67U5FNEk7DUXL3tfaTjeGVzL0LoowusV4 JV088Ke8D3n+PqNorKs4bH7W1V9UWg+wdXI8mTTHXPiYI0+L7zlthiS2ZS4pfnk9bUKN mKSleEDJdTiryksn5ALqZb/jyg1iNwsqF9pFUOBt15HxJ/P0fZskEcyoGWDvRV3+T5LZ pY9TUn/e3bcOKMjGkvjNGNeCjmD2cw6j++mzSrZmLqV0U9vWJQj1TVNt7SzZ8hODN8lK bNz9yRxwv3uSoU7D0IDAIQpouGWoHuRLHKt++30uv7CxloWnyD36VMpctf0G90QBdHmm odYA== 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=2l0plHDgWkgySaTRp2Zwjkk0Efdfjn8xt8+ZDFjL9ak=; b=EPgIjAQibEhI9PuCXyg4jEJYTmwXMGucxMCLnNUUpDkukCrKc9oQz3zD6u85+LOFo0 2P8pjU1kWlcRqUzRZ73saTLTrBjTeHDA9EdrxkImXUn3IBzbhumq2/Tro6BO6ERCxAew xQV9Yz0jrp6vLF5BAdmbso+EiAVEtUB7cwz3XKOaiCTJElTg2guFco7mSXoUtjGU4zPo SFS9BkIgxM2b8+ugTebyh4gY1DCPdbl5lBM3UiPE98J5dsrSUOYZbr3eHRLznxT5tJi1 Y1+8lcp8HouS4U1e9qr5+yz4Lk4BSHo7Scn0N+R2JgalsdPm4C9S7gQMZuIw9rs3zn0I jO5A== X-Gm-Message-State: AKwxytea92g3xfwgGHApktX4uGeumt6OQXnAL9AF3zEpL54pI7e66nxX oiuBC6jvsSaTyu2eqKvt8Rv1JoHnm3tJeQtFvoZnJA== X-Received: by 10.107.89.11 with SMTP id n11mr11391936iob.154.1516393131255; Fri, 19 Jan 2018 12:18:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.170.39 with HTTP; Fri, 19 Jan 2018 12:18:50 -0800 (PST) In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07753802712@SHSMSX103.ccr.corp.intel.com> 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> <37D7C6CF3E00A74B8858931C1DB2F077538026F3@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F07753802712@SHSMSX103.ccr.corp.intel.com> From: Stephane Eranian Date: Fri, 19 Jan 2018 12:18:50 -0800 Message-ID: Subject: Re: [PATCH V5 4/8] perf/x86/intel/uncore: add new data structures for free running counters To: "Liang, Kan" Cc: Peter Zijlstra , "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 10:00 AM, Liang, Kan wrote: > > > On Fri, Jan 19, 2018 at 9:53 AM, Liang, Kan 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. > > > > > > OK. I will check if there are the exact same events on GPs for those > > > free running counters. > > > > > You can measure the bandwidth and utilization on the GP. I am doing it all > > the time. > > Oh, think a bit more. > I think we cannot do the same thing as we did for CPU PMU's fixed counters. > > The counters here are free running counters. They cannot be start/stop. > I think they can because this is all controlled by the event software state. You don't need to read the hw counter each time. If the event is inactive, you return the saved 64-bit counter value. And I believe, this is independent from scheduling. > > Thanks, > Kan > > > > > > Thanks, > > > Kan > > > > > >> > > >> That's what we do for the CPU PMU's fixed counters too. > > >> > > >> Don't invent magic event codes just because.