From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752720AbdEJItT (ORCPT ); Wed, 10 May 2017 04:49:19 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43627 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356AbdEJItS (ORCPT ); Wed, 10 May 2017 04:49:18 -0400 Date: Wed, 10 May 2017 10:49:09 +0200 (CEST) From: Thomas Gleixner To: Michael Ellerman cc: LKML , Peter Zijlstra , Ingo Molnar , Steven Rostedt , Sebastian Siewior Subject: Re: [patch V2 24/24] cpu/hotplug: Convert hotplug locking to percpu rwsem In-Reply-To: <87o9v171dk.fsf@concordia.ellerman.id.au> Message-ID: References: <20170418170442.665445272@linutronix.de> <20170418170554.382344438@linutronix.de> <87o9v171dk.fsf@concordia.ellerman.id.au> 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, 10 May 2017, Michael Ellerman wrote: > Thomas Gleixner writes: > > > @@ -130,6 +130,7 @@ void __static_key_slow_inc(struct static > > * the all CPUs, for that to be serialized against CPU hot-plug > > * we need to avoid CPUs coming online. > > */ > > + lockdep_assert_hotplug_held(); > > jump_label_lock(); > > if (atomic_read(&key->enabled) == 0) { > > atomic_set(&key->enabled, -1); > > I seem to be hitting this assert from the ftrace event selftests, > enabled at boot with CONFIG_FTRACE_STARTUP_TEST=y, using next-20170509 > (on powerpc). > > The stupidly obvious (or perhaps obviously stupid) patch below fixes it: Kinda. There is more horror in that area lurking and I'm still trying to figure out all the convoluted call pathes. Thanks, tglx > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c > index daefdee9411a..5531f7ce8fa6 100644 > --- a/kernel/trace/trace_events.c > +++ b/kernel/trace/trace_events.c > @@ -3241,9 +3241,19 @@ static __init void event_trace_self_tests(void) > continue; > } > > + get_online_cpus(); > + mutex_lock(&event_mutex); > ftrace_event_enable_disable(file, 1); > + mutex_unlock(&event_mutex); > + put_online_cpus(); > + > event_test_stuff(); > + > + get_online_cpus(); > + mutex_lock(&event_mutex); > ftrace_event_enable_disable(file, 0); > + mutex_unlock(&event_mutex); > + put_online_cpus(); > > pr_cont("OK\n"); > } > > cheers >