[RFC PATCH 0/3] Add an option for devices to skip SWIOTLB pre-copy on read.

Keith Busch kbusch at kernel.org
Wed Feb 5 08:18:16 PST 2025


On Wed, Feb 05, 2025 at 04:43:21PM +0100, Christoph Hellwig wrote:
> On Wed, Feb 05, 2025 at 09:54:21AM +0200, Andy Shevchenko wrote:
> > On Tue, Feb 04, 2025 at 11:36:27PM +0000, 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.
> > 
> > Is this really guaranteed? I can imagine surprise power cut or
> > hotplug event, for example, just in the middle of the transfer.
> 
> Many command can return less data than originally mapped.  Get Log Page
> is an example that comes to mind that is heavily used that way.

It's also easy enough for a user to "mistakenly" request more memory
than the device will transfer. The safest thing is to clear any contents
that may get copied back to the user.



More information about the Linux-nvme mailing list