From: Matthew Wilcox <willy@infradead.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
brauner@kernel.org, djwong@kernel.org, bfoster@redhat.com,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v3 1/1] iomap: fix readahead folio access after folio_end_read()
Date: Thu, 22 Jan 2026 19:56:02 +0000 [thread overview]
Message-ID: <aXKA0gD0J5r4w925@casper.infradead.org> (raw)
In-Reply-To: <CAJnrk1Z083d_SXB8uk5oerrdyezDY7LqcqKcir9r02GUmRAU6g@mail.gmail.com>
On Thu, Jan 22, 2026 at 11:50:18AM -0800, Joanne Koong wrote:
> On Thu, Jan 22, 2026 at 8:51 AM Matthew Wilcox <willy@infradead.org> wrote:
> > This is so complicated. I think you made your life harder by adding the
> > bias to read_bytes_pending. What if we just rip most of this out ...
>
> I don't think we can rip this out because when the read starts,
> ifs->read_bytes_pending gets set to the folio size, but if there are
> already some uptodate ranges in the folio, the filesystem IO helper
> will not be reading in the entire folio size, which means we still
> need all this logic to decrement ifs->read_bytes_pending by the bytes
> not read in by the IO helper and to end the folio read.
Well, the patch as-is doesn't work (squinting at it now to see
what I missed ...), but that's not an insurmountable problem.
If we find already-uptodate blocks in the folio, we can just call
iomap_finish_folio_read() for them without starting I/O. That's very
much a corner case, so we need not try hard for efficiency (eg skipping
the ifs_set_range_uptodate() call).
next prev parent reply other threads:[~2026-01-22 19:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 20:04 [PATCH v3 0/1] iomap: fix readahead folio access after folio_end_read() Joanne Koong
2026-01-16 20:04 ` [PATCH v3 1/1] " Joanne Koong
2026-01-21 7:49 ` Christoph Hellwig
2026-01-21 23:13 ` Joanne Koong
2026-01-22 6:22 ` Christoph Hellwig
2026-01-22 16:51 ` Matthew Wilcox
2026-01-22 19:50 ` Joanne Koong
2026-01-22 19:56 ` Matthew Wilcox [this message]
2026-01-22 23:05 ` Joanne Koong
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=aXKA0gD0J5r4w925@casper.infradead.org \
--to=willy@infradead.org \
--cc=bfoster@redhat.com \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@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