public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] vfs write barriers
@ 2025-01-17 18:01 Amir Goldstein
  2025-01-19 21:15 ` Dave Chinner
  0 siblings, 1 reply; 14+ messages in thread
From: Amir Goldstein @ 2025-01-17 18:01 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: lsf-pc, Jan Kara, Christian Brauner, Josef Bacik, Jeff Layton

Hi all,

I would like to present the idea of vfs write barriers that was proposed by Jan
and prototyped for the use of fanotify HSM change tracking events [1].

The historical records state that I had mentioned the idea briefly at the end of
my talk in LSFMM 2023 [2], but we did not really have a lot of time to discuss
its wider implications at the time.

The vfs write barriers are implemented by taking a per-sb srcu read side
lock for the scope of {mnt,file}_{want,drop}_write().

This could be used by users - in the case of the prototype - an HSM service -
to wait for all in-flight write syscalls, without blocking new write syscalls
as the stricter fsfreeze() does.

This ability to wait for in-flight write syscalls is used by the prototype to
implement a crash consistent change tracking method [3] without the
need to use the heavy fsfreeze() hammer.

For the prototype, there is no user API to enable write barriers
or to wait for in-flight write syscalls, there is only an internal user
(fanotify), so the user API is only the fanotify API, but the
vfs infrastructure was written in a way that it could serve other
subsystems or be exposed to user applications via a vfs API.

I wanted to throw these questions to the crowd:
- Can you think of other internal use cases for SRCU scope for
  vfs write operations [*]? other vfs operations?
- Would it be useful to export this API to userspace so applications
  could make use of it?

[*] "vfs write operations" in this context refer to any operation
     that would block on a frozen fs.

I recall that Jeff mentioned there could be some use case related
to providing crash consistency to NFS change cookies, but I am
not sure if this is still relevant after the multigrain ctime work.

Thanks,
Amir.

[1] https://github.com/amir73il/linux/commits/sb_write_barrier
[2] https://lwn.net/Articles/932415/
[3] https://github.com/amir73il/fsnotify-utils/wiki/Hierarchical-Storage-Management-API#modified-files-query

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-03-27 18:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 18:01 [LSF/MM/BPF TOPIC] vfs write barriers Amir Goldstein
2025-01-19 21:15 ` Dave Chinner
2025-01-20 11:41   ` Amir Goldstein
2025-01-23  0:34     ` Dave Chinner
2025-01-23 14:01       ` Amir Goldstein
2025-01-23 18:14     ` Jeff Layton
2025-01-24 21:07       ` Amir Goldstein
2025-02-11 14:53       ` Jan Kara
2025-03-20 17:00         ` Amir Goldstein
2025-03-27 18:23           ` Amir Goldstein
2025-01-27 23:34     ` Dave Chinner
2025-01-29  1:39       ` Amir Goldstein
2025-02-11 21:12         ` Dave Chinner
2025-02-12  8:29           ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox