mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
block: accumulate memory segment gaps per bio
The blk-mq dma iterator has an optimization for requests that align to the device's iommu merge boundary. This boundary may be larger than the device's virtual boundary, but the code had been depending on that queue limit to know ahead of time if the request is guaranteed to align to that optimization. Rather than rely on that queue limit, which many devices may not report, save the lowest set bit of any boundary gap between each segment in the bio while checking the segments. The request stores the value for merging and quickly checking per io if the request can use iova optimizations. Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -79,8 +79,7 @@ static bool blk_map_iter_next(struct request *req, struct blk_map_iter *iter,
|
||||
static inline bool blk_can_dma_map_iova(struct request *req,
|
||||
struct device *dma_dev)
|
||||
{
|
||||
return !((queue_virt_boundary(req->q) + 1) &
|
||||
dma_get_merge_boundary(dma_dev));
|
||||
return !(req_phys_gap_mask(req) & dma_get_merge_boundary(dma_dev));
|
||||
}
|
||||
|
||||
static bool blk_dma_map_bus(struct blk_dma_iter *iter, struct phys_vec *vec)
|
||||
|
||||
Reference in New Issue
Block a user