Re: [PATCH v2 12/16] iomap: add bias for async read requests

Christoph Hellwig
2025-09-15T16:05:53Z

On Fri, Sep 12, 2025 at 01:30:35PM -0400, Joanne Koong wrote:
> I think you're right, this is probably clearer without trying to share
> the function.
>
> I think maybe we can make this even simpler. Right now we mark the
> bitmap uptodate every time a range is read in but I think instead we
> can just do one bitmap uptodate operation for the entire folio when
> the read has completely finished. If we do this, then we can make
> "ifs->read_bytes_pending" back to an atomic_t since we don't save one
> atomic operation from doing it through a spinlock anymore (eg what
> commit f45b494e2a "iomap: protect read_bytes_pending with the
> state_lock" optimized). And then this bias thing can just become:

That's a really good idea, and also gets us closer to the write side.