Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756650Ab2JBWRL (ORCPT ); Tue, 2 Oct 2012 18:17:11 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49118 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755121Ab2JBWRJ (ORCPT ); Tue, 2 Oct 2012 18:17:09 -0400 Date: Wed, 3 Oct 2012 00:17:00 +0200 (CEST) From: Jiri Kosina To: "Srivatsa S. Bhat" Cc: "Paul E. McKenney" , Josh Triplett , linux-kernel@vger.kernel.org, "Paul E. McKenney" Subject: Re: Lockdep complains about commit 1331e7a1bb ("rcu: Remove _rcu_barrier() dependency on __stop_machine()") In-Reply-To: <506B50F1.8070907@linux.vnet.ibm.com> Message-ID: References: <506B50F1.8070907@linux.vnet.ibm.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 Content-Length: 1099 Lines: 39 On Wed, 3 Oct 2012, Srivatsa S. Bhat wrote: > I don't see how this circular locking dependency can occur.. If you are using SLUB, > kmem_cache_destroy() releases slab_mutex before it calls rcu_barrier(). If you are > using SLAB, kmem_cache_destroy() wraps its whole operation inside get/put_online_cpus(), > which means, it cannot run concurrently with a hotplug operation such as cpu_up(). So, I'm > rather puzzled at this lockdep splat.. I am using SLAB here. The scenario I think is very well possible: CPU 0 CPU 1 kmem_cache_destroy() mutex_lock(slab_mutex) _cpu_up() cpu_hotplug_begin() mutex_lock(cpu_hotplug.lock) rcu_barrier() _rcu_barrier() get_online_cpus() mutex_lock(cpu_hotplug.lock) (blocks, CPU 1 has the mutex) __cpu_notify() mutex_lock(slab_mutex) Deadlock. Right? -- Jiri Kosina SUSE Labs -- 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/