Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-fsdevel@vger.kernel.org, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: About using on-stack fsdata pointer for write_begin() and write_end() callbacks
Date: Sun, 10 Nov 2024 21:52:10 -0800	[thread overview]
Message-ID: <ZzGbioLSB3m7ozq1@infradead.org> (raw)
In-Reply-To: <561428e6-3f71-48cb-bd73-46cc21789f6f@gmx.com>

On Mon, Nov 11, 2024 at 02:57:06PM +1030, Qu Wenruo wrote:
> Hi,
> 
> Recently I'm working on migrating btrfs_buffered_write() to utilize
> write_begin() and write_end() callbacks.

Why?  They aren't exactly efficient, and it's just going to create
more Churn for Goldwyn's iomap work.

> Currently only the following filesystems really utilizing that pointer:
> 
> - bcachefs
>   Which is a structure of 24 bytes without any extra pointer.

And as pointed out last time willy and I did go through the users of
write_begin/end this is just dead code that is never called.

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

And that scheme was one of my suggestions back then, together with
removing write_begin/end from address_space_operations because they
aren't operations called by MM/pagecache code, but just callbacks
provided by the file system to perform_generic_write.


  reply	other threads:[~2024-11-11  5:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=ZzGbioLSB3m7ozq1@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /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