aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
authorBodo Stroesser <bstroesser@ts.fujitsu.com>2020-09-10 17:50:41 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2020-09-22 17:31:43 -0400
commit3c9a7c58ea3d8a9d2f7377db3fdb9d7b4da1d480 (patch)
treebc4f489f4636f711299035e03df162a4e1cd7470 /drivers/scsi/ibmvscsi
parentscsi: target: tcmu: Optimize queue_cmd_ring() (diff)
downloadlinux-dev-3c9a7c58ea3d8a9d2f7377db3fdb9d7b4da1d480.tar.xz
linux-dev-3c9a7c58ea3d8a9d2f7377db3fdb9d7b4da1d480.zip
scsi: target: tcmu: Optimize scatter_data_area()
scatter_data_area() has two purposes: 1) Create the iovs for the data area buffer of a SCSI cmd. 2) If there is data in DMA_TO_DEVICE direction, copy the data from sg_list to data area buffer. Both are done in a common loop. In case of DMA_FROM_DEVICE data transfer, scatter_data_area() is called with parameter copy_data = false. But this flag is just used to skip memcpy() for data, while radix_tree_lookup still is called for every dbi of the area area buffer, and kmap and kunmap are called for every page from sg_list and data_area as well as flush_dcache_page() for the data area pages. Since the only thing to do with copy_data = false would be to set up the iovs, this is a noticeable overhead. Rework the iov creation in the main loop of scatter_data_area() providing the new function new_block_to_iov(). Based on this, create the short new function tcmu_setup_iovs() that only writes the iovs with no overhead. This new function is now called instead of scatter_data_area() for bidi buffers and for data buffers in those cases where memcpy() would have been skipped. Link: https://lore.kernel.org/r/20200910155041.17654-4-bstroesser@ts.fujitsu.com Acked-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
0 files changed, 0 insertions, 0 deletions