On Tue, Aug 26, 2025 at 04:33:15PM -0600, Keith Busch wrote: > On Tue, Aug 26, 2025 at 03:57:34PM +0200, Christoph Hellwig wrote: > > On Tue, Aug 26, 2025 at 07:47:46AM -0600, Keith Busch wrote: > > > Currently, the virtual boundary is always compared to bv_offset, which > > > is a page offset. If the virtual boundary is larger than a page, then we > > > need something like "page_to_phys(bv.bv_page) + bv.bv_offset" every > > > place we need to check against the virt boundary. > > > > bv_offset is only guaranteed to be a page offset if your use > > bio_for_each_segment(_all) or the low-level helpers implementing > > it and not bio_for_each_bvec(_all) where it can be much larger > > than PAGE_SIZE. > > Yes, good point. So we'd have a folio offset when it's not a single > page, but I don't think we want to special case large folios for every > virt boundary check. It's looking like replace bvec's "page + offset" > with phys addrs, yeah?! Basically everything should be using physical address. The page + offset is just a weird and inefficient way to represent that and we really need to get rid of it.