Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753925AbcDTNaT (ORCPT ); Wed, 20 Apr 2016 09:30:19 -0400 Received: from www.linutronix.de ([62.245.132.108]:44333 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbcDTNaR (ORCPT ); Wed, 20 Apr 2016 09:30:17 -0400 Date: Wed, 20 Apr 2016 15:28:43 +0200 (CEST) From: Thomas Gleixner To: Kan Liang 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 In-Reply-To: <1460708620-47969-1-git-send-email-kan.liang@intel.com> Message-ID: References: <1460708620-47969-1-git-send-email-kan.liang@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1225 Lines: 48 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? Thanks, tglx