From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754503AbdEXSrI (ORCPT ); Wed, 24 May 2017 14:47:08 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:33653 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754376AbdEXSrH (ORCPT ); Wed, 24 May 2017 14:47:07 -0400 Date: Wed, 24 May 2017 20:47:00 +0200 (CEST) From: Thomas Gleixner To: "Paul E. McKenney" cc: LKML , Peter Zijlstra , Ingo Molnar , Steven Rostedt , Sebastian Siewior , Mathieu Desnoyers , Masami Hiramatsu Subject: Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order In-Reply-To: <20170524183018.GH3956@linux.vnet.ibm.com> Message-ID: References: <20170524081511.203800767@linutronix.de> <20170524081548.930941109@linutronix.de> <20170524183018.GH3956@linux.vnet.ibm.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 May 2017, Paul E. McKenney wrote: > > @@ -8920,7 +8912,7 @@ perf_event_mux_interval_ms_store(struct > > pmu->hrtimer_interval_ms = timer; > > > > /* update all cpuctx for this PMU */ > > - get_online_cpus(); > > + cpus_read_lock(); > > OK, I'll bite... > > Why is this piece using cpus_read_lock() instead of pmus_lock? > > My guess is for the benefit of the cpu_function_call() below, but if > the code instead cycled through the perf_online_mask, wouldn't any > CPU selected be guaranteed to be online? Indeed. > Or is there some reason that it would be necessary to specially handle > CPUs that perf does not consider to be active, but that are still at > least partway online? I have to delegate that question to Peter :) Thanks, tglx