From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: "khazhy@google.com" <khazhy@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RFC] nfsd: avoid recursive locking through fsnotify
Date: Sun, 27 Mar 2022 21:14:59 +0300 [thread overview]
Message-ID: <CAOQ4uxi6G+VtPzKQwrvZfo_cCF8067vgOAPHrYB6ZZAqujKF1A@mail.gmail.com> (raw)
In-Reply-To: <20220325092911.fnttlyrvw7qzggc7@quack3.lan>
> > I think I might have misunderstood you and you meant that the
> > SINGLE_DEPTH_NESTING subcalls should be eliminated and then
> > we are left with two lock classes.
> > Correct?
>
> Yeah, at least at this point I don't see a good reason for using
> SINGLE_DEPTH_NESTING lockdep annotation. In my opinion it has just a
> potential of silencing reports of real locking problems. So removing it and
> seeing what complains would be IMO a way to go.
>
Agreed. In fact, the reason it was added is based on a misunderstanding
of mutex_lock_nested():
Commit 6960b0d909cd ("fsnotify: change locking order") changed some
of the mark_mutex locks in direct reclaim path to use:
mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING);
This change is explained:
"...It uses nested locking to avoid deadlock in case we do the final
iput() on an inode which still holds marks and thus would take the
mutex again when calling fsnotify_inode_delete() in destroy_inode()."
Pushed the fix along with conversion of all backends to fsnotify_group_lock()
to fan_evictable branch, which I am still testing.
It's worth noting that I found dnotify to be not fs reclaim safe, because
dnotify_flush() is called from any filp_close() (problem is explained in the
commit message), which contradicts my earlier argument that legacy
backends "must be deadlock safe or we would have gotten deadlock
reports by now".
So yeh, eventually, we may set all legacy backends NOFS, but I would like
to try and exempt inotify and audit for now to reduce the chance of regressions.
Thanks,
Amir.
next prev parent reply other threads:[~2022-03-27 18:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220319001635.4097742-1-khazhy@google.com>
2022-03-19 0:36 ` Trond Myklebust
2022-03-19 1:45 ` Khazhy Kumykov
2022-03-19 9:36 ` Amir Goldstein
2022-03-21 11:23 ` Jan Kara
2022-03-21 11:56 ` Amir Goldstein
2022-03-21 14:51 ` Jan Kara
2022-03-22 22:41 ` Amir Goldstein
2022-03-23 10:41 ` Jan Kara
2022-03-23 11:40 ` Amir Goldstein
2022-03-23 13:48 ` Jan Kara
2022-03-23 14:00 ` Amir Goldstein
2022-03-23 14:28 ` Jan Kara
2022-03-23 15:46 ` Amir Goldstein
2022-03-23 19:31 ` Amir Goldstein
2022-03-24 19:17 ` Amir Goldstein
2022-03-25 9:29 ` Jan Kara
2022-03-27 18:14 ` Amir Goldstein [this message]
2022-03-21 22:50 ` Trond Myklebust
2022-03-21 23:36 ` Khazhy Kumykov
2022-03-21 23:50 ` Trond Myklebust
2022-03-22 10:37 ` Jan Kara
2022-03-21 17:06 ` Khazhy Kumykov
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=CAOQ4uxi6G+VtPzKQwrvZfo_cCF8067vgOAPHrYB6ZZAqujKF1A@mail.gmail.com \
--to=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=khazhy@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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