From: Dave Chinner <david@fromorbit.com>
To: Luis Henriques <luis@igalia.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
Bernd Schubert <bschubert@ddn.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Matt Harvey <mharvey@jumptrading.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] fuse: add new function to invalidate cache for all inodes
Date: Tue, 18 Feb 2025 11:55:38 +1100 [thread overview]
Message-ID: <Z7PaimnCjbGMi6EQ@dread.disaster.area> (raw)
In-Reply-To: <20250217133228.24405-3-luis@igalia.com>
On Mon, Feb 17, 2025 at 01:32:28PM +0000, Luis Henriques wrote:
> Currently userspace is able to notify the kernel to invalidate the cache
> for an inode. This means that, if all the inodes in a filesystem need to
> be invalidated, then userspace needs to iterate through all of them and do
> this kernel notification separately.
>
> This patch adds a new option that allows userspace to invalidate all the
> inodes with a single notification operation. In addition to invalidate
> all the inodes, it also shrinks the sb dcache.
You still haven't justified why we should be exposing this
functionality in a low level filesystem ioctl out of sight of the
VFS.
User driven VFS cache invalidation has long been considered a
DOS-in-waiting, hence we don't allow user APIs to invalidate caches
like this. This is one of the reasons that /proc/sys/vm/drop_caches
requires root access - it's system debug and problem triage
functionality, not a production system interface....
Every other situation where filesystems invalidate vfs caches is
during mount, remount or unmount operations. Without actually
explaining how this functionality is controlled and how user abuse
is not possible (e.g. explain the permission model and/or how only
root can run this operation), it is not really possible to determine
whether we should unconditional allow VFS cache invalidation outside
of the existing operation scope....
FInally, given that the VFS can only do best-effort invalidation
and won't provide FUSE (or any other filesystem) with any cache
invalidation guarantees outside of specific mount and unmount
contexts, I'm not convinced that this is actually worth anything...
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2025-02-18 0:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 13:32 [PATCH v6 0/2] fuse: allow notify_inval for all inodes Luis Henriques
2025-02-17 13:32 ` [PATCH v6 1/2] vfs: export invalidate_inodes() Luis Henriques
2025-02-18 0:39 ` Dave Chinner
2025-02-17 13:32 ` [PATCH v6 2/2] fuse: add new function to invalidate cache for all inodes Luis Henriques
2025-02-18 0:55 ` Dave Chinner [this message]
2025-02-18 9:15 ` Miklos Szeredi
2025-02-18 10:04 ` Luis Henriques
2025-02-18 10:34 ` Miklos Szeredi
2025-02-18 11:51 ` Luis Henriques
2025-02-18 14:26 ` Miklos Szeredi
2025-02-18 18:11 ` Luis Henriques
2025-02-18 22:05 ` Dave Chinner
2025-02-19 11:23 ` Luis Henriques
2025-02-19 15:39 ` Miklos Szeredi
2025-02-19 16:31 ` Luis Henriques
2025-02-18 21:29 ` Dave Chinner
2025-02-18 21:44 ` Dave Chinner
2025-02-18 9:07 ` Miklos Szeredi
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=Z7PaimnCjbGMi6EQ@dread.disaster.area \
--to=david@fromorbit.com \
--cc=brauner@kernel.org \
--cc=bschubert@ddn.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luis@igalia.com \
--cc=mharvey@jumptrading.com \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.