[Top] [All Lists]

Re: [3.14-rc5 xfs] Lockdep warning

To: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [3.14-rc5 xfs] Lockdep warning
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 11 Mar 2014 08:08:37 +1100
Cc: xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <201403101955.AAI04114.QJOFFFtHMSOLOV@xxxxxxxxxxxxxxxxxxx>
References: <201403101955.AAI04114.QJOFFFtHMSOLOV@xxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Mar 10, 2014 at 07:55:19PM +0900, Tetsuo Handa wrote:
> I get below lockdep warning as of 1dc3217d on linux.git. I guess the situation
> is same as of v3.14-rc6 because there is no changes in fs/xfs directory 
> between
> 1dc3217d and v3.14-rc6.

False positive.  Lockdep is complaining about having different page
fault lock heirarchies for regular files versus directories. It's
too stupid to understand that the directory and regular inodes have
differnet lock classes and so therefore this:

> [   96.098894]  Possible unsafe locking scenario:
> [   96.099795]        CPU0                    CPU1
> [   96.100234]        ----                    ----
> [   96.100666]   lock(&(&ip->i_lock)->mr_lock);
> [   96.101158]                                lock(&mm->mmap_sem);
> [   96.101597]                                lock(&(&ip->i_lock)->mr_lock);
> [   96.102030]   lock(&mm->mmap_sem);

is impossible, because what it really is:

        CPU0                    CPU1
        ilock (IS_DIR)

cannot deadlock because there two different inode locks involved

So, to shut lockdep up, we've got to fundamentally alter the locking
strategy. The current code is not broken, but we've now got to jump
throw complex hoops to make the locking validator understand that
it's not broken. This is a great example of how lockdep can be
considered harmful....

Solutions being discussed in this thread:


> Also, the culprit commits were already backported to
> RHEL7 beta somewhere between 3.10.0-90.el7 and 3.10.0-97.el7 .

That should already be sorted out. :)


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>