aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mul.c
diff options
context:
space:
mode:
authorChao Gao <[email protected]>2022-04-13 08:32:22 +0200
committerChristoph Hellwig <[email protected]>2022-04-14 06:30:39 +0200
commit9e02977bfad006af328add9434c8bffa40e053bb (patch)
treefdd9d545aa8ae964f424f2be43bcd3cd61be2b7f /lib/mpi/mpi-mul.c
parent4fe87e818ea492ade079cc01a31d088e445f8539 (diff)
dma-direct: avoid redundant memory sync for swiotlb
When we looked into FIO performance with swiotlb enabled in VM, we found swiotlb_bounce() is always called one more time than expected for each DMA read request. It turns out that the bounce buffer is copied to original DMA buffer twice after the completion of a DMA request (one is done by in dma_direct_sync_single_for_cpu(), the other by swiotlb_tbl_unmap_single()). But the content in bounce buffer actually doesn't change between the two rounds of copy. So, one round of copy is redundant. Pass DMA_ATTR_SKIP_CPU_SYNC flag to swiotlb_tbl_unmap_single() to skip the memory copy in it. This fix increases FIO 64KB sequential read throughput in a guest with swiotlb=force by 5.6%. Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code") Reported-by: Wang Zhaoyang1 <[email protected]> Reported-by: Gao Liang <[email protected]> Signed-off-by: Chao Gao <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions