Re: [PATCH v1 07/16] iomap: iterate through entire folio in iomap_readpage_iter()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 3, 2025 at 11:14 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Fri, Aug 29, 2025 at 04:56:18PM -0700, Joanne Koong wrote:
> > Iterate through the entire folio in iomap_readpage_iter() in one go
> > instead of in pieces.
>
> Pieces I think here referes to the ranges returned by
> iomap_adjust_read_range?  I.e. "iterate over all non-update ranges
> in a single call to iomap_readpage_iter instead of leaving the
> partial folio iteration to the caller"?

I like your wording a lot better, I'll use this instead. Thanks.

>
> > This will be needed for supporting user-provided
> > async read folio callbacks (not yet added).
>
> Can you explain why it needs that in a bit more detail here?

I'll add more detail to this in the commit message in v2.

This is needed because a "bias" needs to be added before we issue any
async requests for the folio (and then correspondingly removed when
all async requests have been issued). iomap writeback does the same
thing. This is to prevent prematurely (and wrongly) ending the read on
the folio if the first async request is completed before the next ones
are issued (eg, when the first async request completes and calls
iomap_finish_folio_read(), "ifs->read_bytes_pending -= len" would be 0
which will call folio_end_read()).

>
> > +             /*
> > +              * We should never in practice hit this case since
> > +              * the iter length matches the readahead length.
> > +              */
> > +             WARN_ON(!ctx->cur_folio);
> > +             ctx->folio_unlocked = false;
>
> That should be a WARN_ON_ONCE.  And probably return an error?

Good idea, i will make this change for v2.


Thanks,
Joanne
>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux