[RFC PATCH 0/3] Add an option for devices to skip SWIOTLB pre-copy on read.
Robin Murphy
robin.murphy at arm.com
Wed Feb 5 03:46:06 PST 2025
On 2025-02-04 11:36 pm, Jianxiong Gao wrote:
> Removes an extra memory copy that occurs during IO read
> operations through the SWIOTLB. During high throughput
> read workloads, this extra copy is causing a lot of stress
> on the SWIOTLB.
>
> With high performance devices, for example NVMe devices,
> the device will be overwriting the entire buffer. In such
> cases the entire pre-copy is redundent, only to slow down
> the overall bounce buffering.
>
> We propose to add a full_buffer_write flag to the
> device_dma_parameters flag. When the flag is set the pre-copy
> can be omitted to boost performance.
No. We already went through this a couple of weeks ago[1]. It's not
about what the driver intends the device to do, it's about what happens
if for whatever reason it then *doesn't* do that.
Thanks,
Robin.
[1]
https://lore.kernel.org/lkml/9582878b-1ce7-4fc4-9b45-b72bba722f49@arm.com/
>
> Jianxiong Gao (3):
> add full_buffer_write flag to struct device_dma_parameters
> skip swiotlb pre copy if the device does full buffer write.
> set full_buffer_write for nvme devices.
>
> drivers/nvme/host/pci.c | 1 +
> include/linux/device.h | 1 +
> include/linux/dma-mapping.h | 15 +++++++++++++++
> kernel/dma/swiotlb.c | 3 ++-
> 4 files changed, 19 insertions(+), 1 deletion(-)
>
More information about the Linux-nvme
mailing list