Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1649952
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order |
| Date | 2017-05-24 23:20 +0200 |
| Message-ID | <tKLRf-7y3-7@gated-at.bofh.it> (permalink) |
| References | <tKzQ6-8hN-3@gated-at.bofh.it> <tKzQ6-8hN-5@gated-at.bofh.it> <tKJmp-5SS-9@gated-at.bofh.it> <tKJw6-5Wg-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, May 24, 2017 at 08:47:00PM +0200, Thomas Gleixner wrote: > 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 :) Another reason might be a desire to avoid contention on pmus_lock, if this function is called often. If that is the case, I cannot resist suggesting percpu_rw_sem. ;-) Thanx, Paul
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order Thomas Gleixner <tglx@linutronix.de> - 2017-05-24 10:30 +0200
Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-05-24 20:40 +0200
Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order Thomas Gleixner <tglx@linutronix.de> - 2017-05-24 20:50 +0200
Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-05-24 23:20 +0200
Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order Peter Zijlstra <peterz@infradead.org> - 2017-05-30 13:30 +0200
Re: [patch V3 23/32] perf/tracing/cpuhotplug: Fix locking order "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-05-30 18:30 +0200
[tip:smp/hotplug] perf/tracing/cpuhotplug: Fix locking order tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-05-26 10:50 +0200
csiph-web