From: Christoph Hellwig <hch@infradead.org>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFCv2 2/4] iomap: optional zero range dirty folio processing
Date: Sun, 12 Jan 2025 20:51:12 -0800 [thread overview]
Message-ID: <Z4SbwEbcp5AlxMIv@infradead.org> (raw)
In-Reply-To: <Z4Fejwv9XmNkJEGl@bfoster>
On Fri, Jan 10, 2025 at 12:53:19PM -0500, Brian Foster wrote:
> processing.
>
> For example, if we have a largish dirty folio backed by an unwritten
> extent with maybe a single block that is actually dirty, would we be
> alright to just zero the requested portion of the folio as long as some
> part of the folio is dirty? Given the historical ad hoc nature of XFS
> speculative prealloc zeroing, personally I don't see that as much of an
> issue in practice as long as subsequent reads return zeroes, but I could
> be missing something.
That's a very good question I haven't though about much yet. And
everytime I try to think of the speculative preallocations and they're
implications my head begins to implode..
> > > static inline void iomap_iter_reset_iomap(struct iomap_iter *iter)
> > > {
> > > + if (iter->fbatch) {
> > > + folio_batch_release(iter->fbatch);
> > > + kfree(iter->fbatch);
> > > + iter->fbatch = NULL;
> > > + }
> >
> > Does it make sense to free the fbatch allocation on every iteration,
> > or should we keep the memory allocation around and only free it after
> > the last iteration?
> >
>
> In the current implementation the existence of the fbatch is what
> controls the folio lookup path, so we'd only want it for unwritten
> mappings. That said, this could be done differently with a flag or
> something that indicates whether to use the batch. Given that we release
> the folios anyways and zero range isn't the most frequent thing, I
> figured this keeps things simple for now. I don't really have a strong
> preference for either approach, however.
I was just worried about the overhead of allocating and freeing
it all the time. OTOH we probably rarely have more than a single
extent to process with the batch right now.
next prev parent reply other threads:[~2025-01-13 4:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 15:05 [PATCH RFCv2 0/4] iomap: zero range folio batch processing prototype Brian Foster
2024-12-13 15:05 ` [PATCH RFCv2 1/4] iomap: prep work for folio_batch support Brian Foster
2024-12-13 15:05 ` [PATCH RFCv2 2/4] iomap: optional zero range dirty folio processing Brian Foster
2025-01-09 7:20 ` Christoph Hellwig
2025-01-10 17:53 ` Brian Foster
2025-01-13 4:51 ` Christoph Hellwig [this message]
2025-01-13 14:32 ` Brian Foster
2025-01-15 5:47 ` Christoph Hellwig
2025-01-16 14:14 ` Brian Foster
2024-12-13 15:05 ` [PATCH RFCv2 3/4] xfs: always trim mapping to requested range for zero range Brian Foster
2025-01-09 7:22 ` Christoph Hellwig
2024-12-13 15:05 ` [PATCH RFCv2 4/4] xfs: fill dirty folios on zero range of unwritten mappings Brian Foster
2025-01-09 7:26 ` 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=Z4SbwEbcp5AlxMIv@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 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.