From: Christoph Hellwig <hch@infradead.org>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC 1/4] iomap: allow passing a folio into write begin path
Date: Wed, 20 Nov 2024 00:38:41 -0800 [thread overview]
Message-ID: <Zz2gEfgY8G7oTpdV@infradead.org> (raw)
In-Reply-To: <20241119154656.774395-2-bfoster@redhat.com>
On Tue, Nov 19, 2024 at 10:46:53AM -0500, Brian Foster wrote:
> To facilitate batch processing of dirty folios for zero range, tweak
> the write begin path to allow the caller to optionally pass in its
> own folio/pos combination.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> fs/iomap/buffered-io.c | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index ce73d2a48c1e..d1a86aea1a7a 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -781,7 +781,7 @@ static int iomap_write_begin(struct iomap_iter *iter, loff_t pos,
> {
> const struct iomap_folio_ops *folio_ops = iter->iomap.folio_ops;
> const struct iomap *srcmap = iomap_iter_srcmap(iter);
> - struct folio *folio;
> + struct folio *folio = *foliop;
> int status = 0;
>
> BUG_ON(pos + len > iter->iomap.offset + iter->iomap.length);
> @@ -794,9 +794,15 @@ static int iomap_write_begin(struct iomap_iter *iter, loff_t pos,
> if (!mapping_large_folio_support(iter->inode->i_mapping))
> len = min_t(size_t, len, PAGE_SIZE - offset_in_page(pos));
>
> - folio = __iomap_get_folio(iter, pos, len);
> - if (IS_ERR(folio))
> - return PTR_ERR(folio);
> + /*
> + * XXX: Might want to plumb batch handling down through here. For now
> + * let the caller do it.
Yeah, plumbing in the batch here would be nicer.
I suspect doing batch processing might actually be a neat thing for
the normal write patch as well.
next prev parent reply other threads:[~2024-11-20 8:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 15:46 [PATCH RFC 0/4] iomap: zero range folio batch processing prototype Brian Foster
2024-11-19 15:46 ` [PATCH RFC 1/4] iomap: allow passing a folio into write begin path Brian Foster
2024-11-20 8:38 ` Christoph Hellwig [this message]
2024-11-20 14:29 ` Brian Foster
2024-11-19 15:46 ` [PATCH RFC 2/4] iomap: optional zero range dirty folio processing Brian Foster
2024-11-20 8:43 ` Christoph Hellwig
2024-11-20 14:34 ` Brian Foster
2024-11-19 15:46 ` [PATCH RFC 3/4] xfs: always trim mapping to requested range for zero range Brian Foster
2024-11-19 15:46 ` [PATCH RFC 4/4] xfs: fill dirty folios on zero range of unwritten mappings Brian Foster
2024-11-20 8:37 ` [PATCH RFC 0/4] iomap: zero range folio batch processing prototype Christoph Hellwig
2024-11-20 14:29 ` Brian Foster
2024-11-21 5:50 ` Christoph Hellwig
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=Zz2gEfgY8G7oTpdV@infradead.org \
--to=hch@infradead.org \
--cc=bfoster@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.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