From: Al Viro <viro@zeniv.linux.org.uk>
To: Eric Chanudet <echanude@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>, Ian Kent <ikent@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev,
Alexander Larsson <alexl@redhat.com>,
Lucas Karpinski <lkarpins@redhat.com>
Subject: Re: [PATCH v4] fs/namespace: defer RCU sync for MNT_DETACH umount
Date: Sun, 20 Apr 2025 06:54:06 +0100 [thread overview]
Message-ID: <20250420055406.GS2023217@ZenIV> (raw)
In-Reply-To: <20250408210350.749901-12-echanude@redhat.com>
On Tue, Apr 08, 2025 at 04:58:34PM -0400, Eric Chanudet wrote:
> Defer releasing the detached file-system when calling namespace_unlock()
> during a lazy umount to return faster.
>
> When requesting MNT_DETACH, the caller does not expect the file-system
> to be shut down upon returning from the syscall.
Not quite. Sure, there might be another process pinning a filesystem;
in that case umount -l simply removes it from mount tree, drops the
reference and goes away. However, we need to worry about the following
case:
umount -l has succeeded
<several minutes later>
shutdown -r now
<apparently clean shutdown, with all processes killed just fine>
<reboot>
WTF do we have a bunch of dirty local filesystems? Where has the data gone?
Think what happens if you have e.g. a subtree with several local filesystems
mounted in it, along with an NFS on a slow server. Or a filesystem with
shitloads of dirty data in cache, for that matter.
Your async helper is busy in the middle of shutting a filesystem down, with
several more still in the list of mounts to drop. With no indication for anyone
and anything that something's going on.
umount -l MAY leave filesystem still active; you can't e.g. do it and pull
a USB stick out as soon as it finishes, etc. After all, somebody might've
opened a file on it just as you called umount(2); that's expected behaviour.
It's not fully async, though - having unobservable fs shutdown going on
with no way to tell that it's not over yet is not a good thing.
Cost of synchronize_rcu_expedited() is an issue, all right, and it does
feel like an excessively blunt tool, but that's a separate story. Your
test does not measure that, though - you have fs shutdown mixed with
the cost of synchronize_rcu_expedited(), with no way to tell how much
does each of those cost.
Could you do mount -t tmpfs tmpfs mnt; sleep 60 > mnt/foo &
followed by umount -l mnt to see where the costs are?
next prev parent reply other threads:[~2025-04-20 5:54 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 20:58 [PATCH v4] fs/namespace: defer RCU sync for MNT_DETACH umount Eric Chanudet
2025-04-09 10:37 ` Christian Brauner
2025-04-09 13:14 ` Sebastian Andrzej Siewior
2025-04-09 14:02 ` Mateusz Guzik
2025-04-09 14:25 ` Sebastian Andrzej Siewior
2025-04-09 16:04 ` Christian Brauner
2025-04-10 3:04 ` Ian Kent
2025-04-10 8:28 ` Sebastian Andrzej Siewior
2025-04-10 10:48 ` Christian Brauner
2025-04-10 13:58 ` Ian Kent
2025-04-11 2:36 ` Ian Kent
2025-04-09 16:08 ` Eric Chanudet
2025-04-11 15:17 ` Christian Brauner
2025-04-11 18:30 ` Eric Chanudet
2025-04-09 16:09 ` Christian Brauner
2025-04-10 1:17 ` Ian Kent
2025-04-09 13:04 ` Mateusz Guzik
2025-04-09 16:41 ` Eric Chanudet
2025-04-16 22:11 ` Mark Brown
2025-04-17 9:01 ` Christian Brauner
2025-04-17 10:17 ` Ian Kent
2025-04-17 11:31 ` Christian Brauner
2025-04-17 11:49 ` Mark Brown
2025-04-17 15:12 ` Christian Brauner
2025-04-17 15:28 ` Christian Brauner
2025-04-17 15:31 ` Sebastian Andrzej Siewior
2025-04-17 16:28 ` Christian Brauner
2025-04-17 22:33 ` Eric Chanudet
2025-04-18 1:13 ` Ian Kent
2025-04-18 1:20 ` Ian Kent
2025-04-18 8:47 ` Christian Brauner
2025-04-18 12:55 ` Christian Brauner
2025-04-18 19:59 ` Christian Brauner
2025-04-18 21:20 ` Eric Chanudet
2025-04-19 1:24 ` Ian Kent
2025-04-19 10:44 ` Christian Brauner
2025-04-19 13:26 ` Christian Brauner
2025-04-21 0:12 ` Ian Kent
2025-04-21 0:44 ` Al Viro
2025-04-18 0:31 ` Ian Kent
2025-04-18 8:59 ` Christian Brauner
2025-04-19 1:14 ` Ian Kent
2025-04-20 4:24 ` Al Viro
2025-04-20 5:54 ` Al Viro [this message]
2025-04-22 19:53 ` Eric Chanudet
2025-04-23 2:15 ` Al Viro
2025-04-23 15:04 ` Eric Chanudet
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=20250420055406.GS2023217@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=alexl@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=brauner@kernel.org \
--cc=clrkwllms@kernel.org \
--cc=echanude@redhat.com \
--cc=ikent@redhat.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=lkarpins@redhat.com \
--cc=rostedt@goodmis.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