public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	brauner@kernel.org, wegao@suse.com, sashal@kernel.org,
	hch@infradead.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] iomap: don't mark folio uptodate if read IO has bytes pending
Date: Tue, 24 Feb 2026 07:16:47 -0800	[thread overview]
Message-ID: <aZ3A39jztKdUmWoT@infradead.org> (raw)
In-Reply-To: <CAJnrk1Zk1hHCoC4xaY_KT0m_04CQ=pO6j3e1tGrdj7LTf5BHsA@mail.gmail.com>

On Mon, Feb 23, 2026 at 03:53:15PM -0800, Joanne Koong wrote:
> > There are three ways that iomap can be reading into the pagecache:
> > a) async ->readahead,
> > b) synchronous ->read_folio (page faults), and
> 
> b) is async as well. The code for b) and a) are exactly the same (the
> logic in iomap_read_folio_iter())

Yes.

> > This is confusing to me.  It would be more straightforward (I think) if
> > we just did it for all cases instead of adding more conditionals.  IOWs,
> > how hard would it be to consolidate the read code so that there's one
> > function that iomap calls when it has filled out part of a folio.  Is
> > that possible, even though we shouldn't be calling folio_end_read during
> > a pagecache write?
> 
> imo, I don't think the synchronous ->read_folio_range() for buffered
> writes should be consolidated with the async read logic.

Yes.  I've been thinking about that on and off, but unfortunately so far
I've not come up with a good idea how to merge the code.  Doing so would
be very useful for many reasons.

The problem with that isn't really async vs sync; ->read_folio clearly
shows you you turn underlying asynchronous logic into a synchronous call.
It's really about the range logic, where the writer preparation might
want to only read the head and the tail segments of a folio.

But if we can merge that into the main implementation and have a single
core implementation we'd be much better off.

Anyone looking for a "little" project? :)

      reply	other threads:[~2026-02-24 15:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  0:39 [PATCH v1 0/1] iomap: don't mark folio uptodate if read IO has bytes pending Joanne Koong
2026-02-19  0:39 ` [PATCH v1 1/1] " Joanne Koong
2026-02-19  2:45   ` Darrick J. Wong
2026-02-19  4:23     ` Matthew Wilcox
2026-02-19  6:11       ` Darrick J. Wong
2026-02-19  6:11         ` Christoph Hellwig
2026-02-20 22:13         ` Joanne Koong
2026-02-20 23:45       ` Darrick J. Wong
2026-02-23 23:53         ` Joanne Koong
2026-02-24 15:16           ` Christoph Hellwig [this message]

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=aZ3A39jztKdUmWoT@infradead.org \
    --to=hch@infradead.org \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=wegao@suse.com \
    --cc=willy@infradead.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