From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965293AbbKDKuO (ORCPT ); Wed, 4 Nov 2015 05:50:14 -0500 Received: from casper.infradead.org ([85.118.1.10]:46418 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbbKDKuM (ORCPT ); Wed, 4 Nov 2015 05:50:12 -0500 Date: Wed, 4 Nov 2015 11:50:10 +0100 From: Peter Zijlstra To: Dave Jones , Linux Kernel , Ingo Molnar , Stephane Eranian Cc: Paul McKenney , Andi Kleen Subject: Re: perf related lockdep bug Message-ID: <20151104105010.GA11639@twins.programming.kicks-ass.net> References: <20151104051717.GA6098@codemonkey.org.uk> <20151104102151.GG17308@twins.programming.kicks-ass.net> <20151104102800.GZ11639@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151104102800.GZ11639@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2015 at 11:28:00AM +0100, Peter Zijlstra wrote: > On Wed, Nov 04, 2015 at 11:21:51AM +0100, Peter Zijlstra wrote: > > > The problem appears to be due to the new RCU expedited grace period > > stuff, with rcu_read_unlock() now randomly trying to acquire locks it > > previously didn't. > > > > Lemme go look at those rcu bits again.. > > Paul, I think this is because of: > > 8203d6d0ee78 ("rcu: Use single-stage IPI algorithm for RCU expedited grace period") > > What happens is that the IPI comes in and tags any random > rcu_read_unlock() with the special bit, which then goes on and takes > locks. > > Now the problem is that we have scheduler activity inside this lock; > the one reported lockdep seems easy enough to fix, see below. > > I'll got and see if there's more sites than can cause this. *sigh* yes, there's gobs more. In fact the very first one I looked at: rcu_dump_cpu_stacks() raw_spin_lock_irqsave(&rnp->lock, flags); dump_cpu_task() pr_info() That too will end up doing wakeups.. idem: - print_other_cpu_stall() - rcu_print_details_task_stall_rnp() So just like you had to pull out all the rcu_gp_kthead_wake() calls from under rnp->lock, so too must we pull out all implied wakeups, which very much include printk().