From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756523AbaEaOsY (ORCPT ); Sat, 31 May 2014 10:48:24 -0400 Received: from mail-pb0-f52.google.com ([209.85.160.52]:38928 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbaEaOsW (ORCPT ); Sat, 31 May 2014 10:48:22 -0400 Date: Sat, 31 May 2014 07:48:19 -0700 (PDT) From: Linus Torvalds To: Josh Boyer cc: Al Viro , Mika Westerberg , Linux Kernel Mailing List , Miklos Szeredi , linux-fsdevel Subject: Re: [git pull] Re: fs/dcache.c - BUG: soft lockup - CPU#5 stuck for 22s! [systemd-udevd:1667] In-Reply-To: Message-ID: References: <20140529154454.GK18016@ZenIV.linux.org.uk> <20140529162307.GL18016@ZenIV.linux.org.uk> <20140529165351.GM18016@ZenIV.linux.org.uk> <20140529185201.GN18016@ZenIV.linux.org.uk> <20140530081238.GA1957@lahna.fi.intel.com> <20140530152151.GR18016@ZenIV.linux.org.uk> <20140530164815.GS18016@ZenIV.linux.org.uk> <20140530171408.GT18016@ZenIV.linux.org.uk> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) 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 Sat, 31 May 2014, Josh Boyer wrote: > > One of my machines got the lockdep report below when booting a kernel > that contained these patches. I think this is just a lacking annotation. We do nest dentry d_lock locking, and in order to avoid ABBA deadlocks the rule is that we lock things in topological order (parent dentry first). lock_parent() is very careful about that, but doesn't actually tell lockdep about it. This trivial oneliner should fix it. Linus --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index bce851dc03ef..be2bea834bf4 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -553,7 +553,7 @@ again: } rcu_read_unlock(); if (parent != dentry) - spin_lock(&dentry->d_lock); + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); else parent = NULL; return parent;