From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by kanga.kvack.org (Postfix) with ESMTP id 1E8C89000DF for ; Mon, 3 Oct 2011 16:33:57 -0400 (EDT) Received: from /spool/local by us.ibm.com with XMail ESMTP for from ; Mon, 3 Oct 2011 16:33:44 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p93KVeKn154434 for ; Mon, 3 Oct 2011 16:31:57 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p93KVeUN011817 for ; Mon, 3 Oct 2011 16:31:40 -0400 Date: Mon, 3 Oct 2011 13:31:39 -0700 From: "Paul E. McKenney" Subject: Re: lockdep recursive locking detected (rcu_kthread / __cache_free) Message-ID: <20111003203139.GH2403@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20111003175322.GA26122@sucs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111003175322.GA26122@sucs.org> Sender: owner-linux-mm@kvack.org List-ID: To: Sitsofe Wheeler Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, cl@linux-foundation.org, penberg@kernel.org, mpm@selenic.com, linux-mm@kvack.org On Mon, Oct 03, 2011 at 06:53:22PM +0100, Sitsofe Wheeler wrote: > Hi, > > While running 3.1.0-rc8 the following lockdep warning (seemingly related > to RCU) was printed as the kernel was starting. > > > udev: starting version 151 > udevd (263): /proc/263/oom_adj is deprecated, please use /proc/263/oom_score_adj instead. > > ============================================= > [ INFO: possible recursive locking detected ] > 3.1.0-rc8-dirty #508 > --------------------------------------------- > rcu_kthread/6 is trying to acquire lock: > (&(&parent->list_lock)->rlock){..-...}, at: [] __cache_free+0x2dd/0x382 > > but task is already holding lock: > (&(&parent->list_lock)->rlock){..-...}, at: [] __cache_free+0x2dd/0x382 > > other info that might help us debug this: > Possible unsafe locking scenario: > > CPU0 > ---- > lock(&(&parent->list_lock)->rlock); > lock(&(&parent->list_lock)->rlock); > > *** DEADLOCK *** > > May be due to missing lock nesting notation > > 1 lock held by rcu_kthread/6: > #0: (&(&parent->list_lock)->rlock){..-...}, at: [] __cache_free+0x2dd/0x382 > > stack backtrace: > Pid: 6, comm: rcu_kthread Not tainted 3.1.0-rc8-dirty #508 > Call Trace: > [] __lock_acquire+0xb90/0xc0e > [] ? _raw_spin_unlock_irqrestore+0x2f/0x46 > [] ? debug_object_active_state+0x94/0xbc > [] ? rcuhead_fixup_activate+0x26/0x4c > [] lock_acquire+0x5b/0x72 > [] ? __cache_free+0x2dd/0x382 > [] _raw_spin_lock+0x25/0x34 > [] ? __cache_free+0x2dd/0x382 > [] __cache_free+0x2dd/0x382 > [] kmem_cache_free+0x3e/0x5b > [] slab_destroy+0x11e/0x126 > [] free_block+0xe5/0x112 > [] __cache_free+0x320/0x382 The first lock was acquired here in an RCU callback. The later lock that lockdep complained about appears to have been acquired from a recursive call to __cache_free(), with no help from RCU. This looks to me like one of the issues that arise from the slab allocator using itself to allocate slab metadata. So the allocator guys (added to CC) need to sort this one out. Thanx, Paul > [] ? file_free_rcu+0x32/0x39 > [] kmem_cache_free+0x3e/0x5b > [] file_free_rcu+0x32/0x39 > [] rcu_process_callbacks+0x95/0xa8 > [] rcu_kthread+0xb9/0xd2 > [] ? wake_up_bit+0x1b/0x1b > [] ? rcu_process_callbacks+0xa8/0xa8 > [] kthread+0x6c/0x71 > [] ? __init_kthread_worker+0x42/0x42 > [] kernel_thread_helper+0x6/0xd > > -- > Sitsofe | http://sucs.org/~sits/ > -- > 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/ > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org