linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About using on-stack fsdata pointer for write_begin() and write_end() callbacks
@ 2024-11-11  4:27 Qu Wenruo
  2024-11-11  5:52 ` Christoph Hellwig
  0 siblings, 1 reply; 9+ messages in thread
From: Qu Wenruo @ 2024-11-11  4:27 UTC (permalink / raw)
  To: linux-fsdevel, linux-btrfs

Hi,

Recently I'm working on migrating btrfs_buffered_write() to utilize
write_begin() and write_end() callbacks.

Currently only the following filesystems really utilizing that pointer:

- bcachefs
   Which is a structure of 24 bytes without any extra pointer.

- f2fs (for compression)
   Which is holding a pointer to an array of pages.

- ext4
   Only utilize that pointer as a flag for ext4_da_write_begin()

- ocfs2
   This a large structure holding a lot of things

- (Future) btrfs
   Only holds a pointer and a bool.
   (Also needs a way to pass ki_flags to support IOCB_NOWAIT though)

Thus I'm wondering should we make perform_generic_write() to accept a
*fsdata pointer, other than making write_begin() to allocate one.
So that we only need to allocate the memory (or use the on-stack one)
once per write, other than once per folio.

This will cause no change to f2fs/ext4, but should benefit
ocfs2/bcachefs and of-course btrfs.

Or is there some special corner case that relies on the current behavior?

Thanks,
Qu

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

end of thread, other threads:[~2024-11-12  6:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11  4:27 About using on-stack fsdata pointer for write_begin() and write_end() callbacks Qu Wenruo
2024-11-11  5:52 ` Christoph Hellwig
2024-11-11  7:36   ` Qu Wenruo
2024-11-12  5:05     ` Christoph Hellwig
2024-11-12  5:31       ` Qu Wenruo
2024-11-12  5:41         ` Christoph Hellwig
2024-11-12  6:03           ` Qu Wenruo
2024-11-12  6:06             ` Christoph Hellwig
2024-11-12  6:13               ` Qu Wenruo

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).