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

2020-09-01 Thread Christoph Hellwig
On Tue, Sep 01, 2020 at 02:05:25PM +0100, Matthew Wilcox wrote: > > > struct page *page = bvec->bv_page; > > > > > > while (length > 0) { > > > size_t count = thp_size(page) - offset; > > > > > >

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

2020-09-01 Thread Matthew Wilcox
On Tue, Sep 01, 2020 at 06:34:26AM +0100, Christoph Hellwig wrote: > On Mon, Aug 31, 2020 at 08:48:37PM +0100, Matthew Wilcox wrote: > > static void iomap_read_end_io(struct bio *bio) > > { > > int i, error = blk_status_to_errno(bio->bi_status); > > > > for (i = 0; i < bio->bi_vcnt

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

2020-08-31 Thread Christoph Hellwig
On Mon, Aug 31, 2020 at 08:48:37PM +0100, Matthew Wilcox wrote: > static void iomap_read_end_io(struct bio *bio) > { > int i, error = blk_status_to_errno(bio->bi_status); > > for (i = 0; i < bio->bi_vcnt; i++) { > struct bio_vec *bvec = &bio->bi_io_vec[i]; This sho

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

2020-08-31 Thread Matthew Wilcox
On Thu, Aug 27, 2020 at 09:44:31AM +0100, Christoph Hellwig wrote: > 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 f

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

2020-08-27 Thread Christoph Hellwig
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 ea

[PATCH 04/11] block: Add bio_for_each_thp_segment_all

2020-08-24 Thread Matthew Wilcox (Oracle)
Iterate once for each THP instead of once for each base page. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/bio.h | 13 + include/linux/bvec.h | 27 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/bio.h b/include/linux/bio.h index