Re: [PATCH 04/11] block: Add bio_for_each_thp_segment_all

From: Christoph Hellwig
Date: Thu Aug 27 2020 - 04:44:34 EST


On Mon, Aug 24, 2020 at 04:16:53PM +0100, Matthew Wilcox (Oracle) wrote:
> Iterate once for each THP instead of once for each base page.

FYI, I've always been wondering if bio_for_each_segment_all is the
right interface for the I/O completions, because we generally don't
need the fake bvecs for each page. Only the first page can have an
offset, and only the last page can be end earlier than the end of
the page size.

It would seem way more efficient to just have a helper that extracts
the offset and end, and just use that in a loop that does the way
cheaper iteration over the physical addresses only. This might (or
might) not be a good time to switch to that model for iomap.