Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752000AbcDUL4B (ORCPT ); Thu, 21 Apr 2016 07:56:01 -0400 Received: from mga11.intel.com ([192.55.52.93]:46303 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbcDUL4A convert rfc822-to-8bit (ORCPT ); Thu, 21 Apr 2016 07:56:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="949905199" From: "Liang, Kan" To: Thomas Gleixner CC: "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "ak@linux.intel.com" , "eranian@google.com" Subject: RE: [PATCH 1/1] perf/x86/intel/uncore: Add support for Intel SKL client uncore Thread-Topic: [PATCH 1/1] perf/x86/intel/uncore: Add support for Intel SKL client uncore Thread-Index: AQHRly5udWndQXy3f0uUHdDjcWBP2Z+SXKSAgACKPBD//43IAIAAhw4wgACYVwCAAMPAEA== Date: Thu, 21 Apr 2016 11:55:56 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077058E5CD5@SHSMSX103.ccr.corp.intel.com> References: <1460708620-47969-1-git-send-email-kan.liang@intel.com> <37D7C6CF3E00A74B8858931C1DB2F077058E4102@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F077058E426E@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2293 Lines: 59 > > On Wed, 20 Apr 2016, Liang, Kan wrote: > > > On Wed, 20 Apr 2016, Liang, Kan wrote: > > > > > The stop of the box1 events disables the whole machinery on that > > > > > node and therefor the box0 event is wreckaged as well. Hmm? > > > > > > > > > Right. How about check the SKL_UNC_PERF_GLOBAL_CTL in > enable_event? > > > > If it's cleared, we can reset it there. The drawback is that there > > > > will be an extra rdmsrl and a possible wrmsrl. > > > > > > Well, that does not buy anything as you cannot disable the thing at > > > all, unless you have refcounting. And that refcounting needs to be in the > 'type' > > > struct and that would probably be some real pain to implement. > > > > > > The question is whether we need enable/disable at all. If the type > > > is initialized we enable it and on exit we disable it. Ditto on cpu > > > hotplug - which is also used for init to enable all nodes. > > > > > > So if there is no drawback in letting the thing enabled if no events > > > are armed, then we really can do w/o the enable/disable_box callbacks. > > > > > There is no drawback in letting the thing enabled, but PERF_GLOBAL_CTL > > could be disabled after Package C7. I add the enable/disable thing to > > try to workaround it. > > I don't see how that solves it. If a counter is active, then C7 will stop it and > you wont get anything useful from it after returning from C7. Or does an > active counter prevent C7? Right, the workaround doesn't cover all cases. It helps for the new events and the cases that monitoring a busy system. A busy system means it never enter C7 during the counting. I will mention it in the changelog of V2. > > > I once did the test on a SKL laptop. If the machine goes idle for a > > while, then the uncore counter will always return 0. For fixing it, we > > have to re-enable PERF_GLOBAL_CTL. > > Hmm, but that does only help for new events after returning from C7, right? Yes. > > > I think I made a typo in previous reply. I mean we can check it or > > just force rewrite the PERF_GLOBAL_CTL in enable_box. We don't need > > disable_box since there is no drawback in letting the thing enabled. > > Sure, but then you can just unconditionally enable it. IOW, leave the enable > callback as is. Will do that in V2. Thanks, Kan