From: Jan Kara <jack@suse.cz>
To: lsf-pc@lists.linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: [TOPIC] Last iput() from flusher thread, last fput() from munmap()...
Date: Tue, 27 Mar 2012 23:08:58 +0200 [thread overview]
Message-ID: <20120327210858.GH5020@quack.suse.cz> (raw)
Hello,
maybe the name of this topic could be "How hard should be life of
filesystems?" but that's kind of broad topic and suggests too much of
bikeshedding. I'd like to concentrate on concrete possible pain points
between filesystems & VFS (possibly writeback or even generally MM).
Lately, I've myself came across the two issues in $SUBJECT:
1) dropping of last file reference can happen from munmap() and in that
case mmap_sem will be held when ->release() is called. Even more it
could be held when ->evict_inode() is called to delete inode because
inode was unlinked.
2) since flusher thread takes inode reference when writing inode out, the
last inode reference can be dropped from flusher thread. Thus inode may
get deleted in the flusher thread context. This does not seem that
problematic on its own but if we realize progress of memory reclaim
depends (at least from a longterm perspective) on flusher thread making
progress, things start looking a bit uncertain. Even more so when we
would like avoid ->writepage() calls from reclaim and let flusher thread
do the work instead. That would then require filesystems to carefully
design their ->evict_inode() routines so that things are not
deadlockable.
Both these issues should be avoidable (we can postpone fput() after we
drop mmap_sem; we can tweak inode refcounting to avoid last iput() from
flusher thread) but obviously there's some cost in the complexity of generic
layer. So the question is, is it worth it?
Certainly we can also discuss other pain points if people come with them.
We should have enough know-how in place to be able to tell which changes
are reasonably possible and which are not...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next reply other threads:[~2012-03-27 21:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 21:08 Jan Kara [this message]
2012-03-28 2:38 ` [TOPIC] Last iput() from flusher thread, last fput() from munmap() Al Viro
2012-03-28 4:45 ` Dave Chinner
2012-03-28 9:04 ` Steven Whitehouse
2012-03-28 11:54 ` [Lsf-pc] " Jan Kara
2012-03-28 14:07 ` Steven Whitehouse
2012-03-28 12:10 ` Jan Kara
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=20120327210858.GH5020@quack.suse.cz \
--to=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).