On Wed, Sep 04, 2024 at 08:26:02AM -0700, Keith Busch wrote: > From: Keith Busch <kbusch@xxxxxxxxxx> > > The segments are already packed to the queue limits when adding them to > the bio, so each vector is already its own segment. No need to attempt > compacting them even more. Well. For one the immutable bio API is explicitly designed so that the callers don't need to know the limits, so this isn't really true. And the other thing the map_sg helpers for data and metadata do is cross-bio merges, that is if the end of one bio is contiguous with the start of the next, it will merge the segments. I don't really know how useful that is there days - maybe we can removed it with a proper rational after a bit of testing. Again the current code closely mirrors the code for mapping the data bvecs, and I'd preferably keep them as close as possible.