Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754099AbcDTN4s (ORCPT ); Wed, 20 Apr 2016 09:56:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:51329 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcDTN4r convert rfc822-to-8bit (ORCPT ); Wed, 20 Apr 2016 09:56:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,509,1455004800"; d="scan'208";a="962724756" 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+SXKSAgACKPBA= Date: Wed, 20 Apr 2016 13:56:32 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077058E4102@SHSMSX103.ccr.corp.intel.com> References: <1460708620-47969-1-git-send-email-kan.liang@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: 1479 Lines: 51 > On Fri, 15 Apr 2016, kan.liang@intel.com wrote: > > +static void skl_uncore_msr_init_box(struct intel_uncore_box *box) { > > + if (box->pmu->pmu_idx == 0) { > > + wrmsrl(SKL_UNC_PERF_GLOBAL_CTL, > > + SNB_UNC_GLOBAL_CTL_EN | > SKL_UNC_GLOBAL_CTL_CORE_ALL); > > + } > > +} > > + > > +static void skl_uncore_msr_enable_box(struct intel_uncore_box *box) { > > + wrmsrl(SKL_UNC_PERF_GLOBAL_CTL, > > + SNB_UNC_GLOBAL_CTL_EN | > SKL_UNC_GLOBAL_CTL_CORE_ALL); } > > + > > +static void skl_uncore_msr_disable_box(struct intel_uncore_box *box) > > +{ > > + wrmsrl(SKL_UNC_PERF_GLOBAL_CTL, 0); > > +} > > + > > +static void skl_uncore_msr_exit_box(struct intel_uncore_box *box) { > > + if (box->pmu->pmu_idx == 0) > > + wrmsrl(SKL_UNC_PERF_GLOBAL_CTL, 0); } > > The above looks broken. > > init() enables the uncore machinery on the node it is running on. > > start() enables the uncore machinery on the node it is running on. > > stop() disables the uncore machinery on the node it is running on. > > So what happens in the following case: > > start(event(box0), node0) > > start(event(box1), node0) > > stop(event(box1), node0) > > 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. Thanks, Kan