[PATCH] nvme: uring_cmd specific request_queue for SGLs

Christoph Hellwig hch at lst.de
Tue Jun 24 23:09:15 PDT 2025


On Tue, Jun 24, 2025 at 02:14:44PM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch at kernel.org>
> 
> User space passthrough IO commands are committed to using the SGL
> transfer types if the device supports it. The virt_boundary_mask is a
> PRP specific constraint, and this limit causes kernel bounce buffers to
> be used when a user vector could have been handled directly. Avoiding
> unnecessary copies is important for uring_cmd usage as this is a high
> performance interface.

Not really more high performance than the normal I/O path.

> For devices that support SGL, create a new request_queue that drops the
> virt_boundary_mask so that vectored user requests can be used with
> zero-copy performance. Normal read/write will still use the old boundary
> mask, as we can't be sure if forcing all IO to use SGL over PRP won't
> cause unexpected regressions for some devices.

Note that this directly conflict with the new DMA API.  There we do
rely on the virt boundary to gurantee that the IOMMU path can always
coalesce the entire request into a single IOVA mapping.  We could still
do it for the direct mapping path, where it makes a difference, but
we really should do that everywhere, i.e. revist the default
sgl_threshold and see if we could reduce it to 2 * PAGE_SIZE or so
so that we'd only use PRPs for the simple path where we can trivially
do the virt_boundary check right in NVMe.



More information about the Linux-nvme mailing list