Re: [PATCH] scatterlist: Speed up for_each_sg() loop macro

From: Christoph Hellwig
Date: Mon Oct 28 2019 - 12:28:25 EST


On Mon, Oct 28, 2019 at 01:23:20PM -0300, Jason Gunthorpe wrote:
> This testing is making assumptions about how 'nr' is used and the
> construction of the sgl though
>
> If any chains are partially populated, or for some reason the driver
> starts at a different sgl, it will break. You'll need to somehow
> show none of those possibilities are happening.

And there is nothing forcing a particular layout, there just happens
to be a layout that the generic allocator gives you. I'm not even
sure the original patch handles the SCSI case of small inlines segments
properly.