From: Joel Fernandes <joelaf@google.com>
To: NeilBrown <neilb@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@kernel.org>,
Minchan Kim <minchan@kernel.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
Theodore Ts'o <tytso@mit.edu>,
linux-fsdevel@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH RFC] ashmem: Fix lockdep RECLAIM_FS false positive
Date: Wed, 7 Feb 2018 18:29:01 -0800 [thread overview]
Message-ID: <CAJWu+orVE-mnyFJZv6MjP4QJizv6onc0QVs19QR3XH==7hzLYQ@mail.gmail.com> (raw)
In-Reply-To: <87k1vomi74.fsf@notabene.neil.brown.name>
On Wed, Feb 7, 2018 at 4:35 PM, NeilBrown <neilb@suse.com> wrote:
>> On Wed, Feb 7, 2018 at 8:58 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>> [...]
>>>
>>>> Lockdep reports this issue when GFP_FS is infact set, and we enter
>>>> this path and acquire the lock. So lockdep seems to be doing the right
>>>> thing however by design it is reporting a false-positive.
>>>
>>> So I'm not seeing how its a false positive. fs/inode.c sets a different
>>> lock class per filesystem type. So recursing on an i_mutex within a
>>> filesystem does sound dodgy.
>>
>> But directory inodes and file inodes in the same filesystem share the
>> same lock class right?
>
> Not since v2.6.24
> Commit: 14358e6ddaed ("lockdep: annotate dir vs file i_mutex")
>
> You were using 4.9.60. so they should be separate....
>
> Maybe shmem_get_inode() needs to call unlock_new_inode() or just
> lockdep_annotate_inode_mutex_key() after inode_init_owner().
>
> Maybe inode_init_owner() should call lockdep_annotate_inode_mutex_key()
> directly.
Thanks for the ideas! I will test lockdep_annotate_inode_mutex_key
after inode_init_owner in shmem and let you know if the issue goes
away. It seems hugetlbfs does this too (I think for similar reasons).
- Joel
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2018-02-08 2:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 0:49 Joel Fernandes
2018-02-06 22:01 ` Minchan Kim
2018-02-06 22:32 ` Joel Fernandes
2018-02-06 22:55 ` Minchan Kim
2018-02-06 23:16 ` Joel Fernandes
2018-02-07 8:07 ` Peter Zijlstra
2018-02-07 16:09 ` Joel Fernandes
2018-02-07 16:58 ` Peter Zijlstra
2018-02-07 22:27 ` Joel Fernandes
2018-02-08 0:35 ` NeilBrown
2018-02-08 2:29 ` Joel Fernandes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJWu+orVE-mnyFJZv6MjP4QJizv6onc0QVs19QR3XH==7hzLYQ@mail.gmail.com' \
--to=joelaf@google.com \
--cc=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=neilb@suse.com \
--cc=peterz@infradead.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox