Re: [PATCH 2/2] zloop: use blk_rq_nr_phys_segments() instead of iterating bvecs
From: Chaitanya Kulkarni
Date: Tue Nov 11 2025 - 13:19:15 EST
On 11/11/25 01:07, Christoph Hellwig wrote:
> On Sat, Nov 08, 2025 at 04:01:01PM -0700, Caleb Sander Mateos wrote:
>> The number of bvecs can be obtained directly from struct request's
>> nr_phys_segments field via blk_rq_nr_phys_segments(), so use that
>> instead of iterating over the bvecs an extra time.
> Same reason this doesn't work as Ming explained for ublk.
>
> Maybe we should lift this code from loop/zloop into a well documented
> common helper to make it more obvious?
>
>
Absolutely, patch sent with added quantitative data from my experiments,
to prove why above is wrong, please have a look.
-ck