Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755842AbbFRTrs (ORCPT ); Thu, 18 Jun 2015 15:47:48 -0400 Received: from www.linutronix.de ([62.245.132.108]:55387 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbbFRTrm (ORCPT ); Thu, 18 Jun 2015 15:47:42 -0400 Date: Thu, 18 Jun 2015 21:47:36 +0200 (CEST) From: Thomas Gleixner To: Kanaka Juvva cc: kanaka.d.juvva@intel.com, glenn.p.williamson@intel.com, matt.fleming@intel.com, will.auld@intel.com, andi@firstfloor.org, ananth.s.narayan@intel.com, linux-kernel@vger.kernel.org, andrew.j.herdrich@intel.com, tony.luck@intel.com, peterz@infradead.org, x86@kernel.org, mingo@redhat.com, hpa@zytor.com, luto@amacapital.net, dvlasenk@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, peter.p.waskiewicz.jr@intel.com, imammedo@redhat.com, bp@suse.de, ross.zwisler@linux.intel.com, jacob.w.shin@gmail.com, dirk.j.brandewie@intel.com, vikas.shivappa@intel.com, edwin.verplanke@intel.com, tomasz.kantecki@intel.com Subject: Re: [PATCH v1 2/2] x86, perf,cqm: handle CPU hotplug In-Reply-To: <1434653369-5162-1-git-send-email-kanaka.d.juvva@linux.intel.com> Message-ID: References: <1434653369-5162-1-git-send-email-kanaka.d.juvva@linux.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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1299 Lines: 36 On Thu, 18 Jun 2015, Kanaka Juvva wrote: > Added lock in event reader function. The cqm_pick_event_reader() function > accesses cqm_cpumask and it is critical section between this and > cqm_stable(). > > This situation is true when a CPU is hotplugged. Mutex is used to protect > the critical section. > > Signed-off-by: Kanaka Juvva > --- > arch/x86/kernel/cpu/perf_event_intel_cqm.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/perf_event_intel_cqm.c b/arch/x86/kernel/cpu/perf_event_intel_cqm.c > index 1880761..e17e37f 100644 > --- a/arch/x86/kernel/cpu/perf_event_intel_cqm.c > +++ b/arch/x86/kernel/cpu/perf_event_intel_cqm.c > @@ -1239,12 +1239,15 @@ static inline void cqm_pick_event_reader(int cpu) > int phys_id = topology_physical_package_id(cpu); > int i; > > + mutex_lock(&cache_mutex); I already explained it to Vikas. You CANNOT take a mutex in that code path as it runs with interrupts disabled on a CPU which cannot schedule. Sigh. tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/