[PATCH] nvme-pci: always use blk_map_iter for metadata

Keith Busch kbusch at kernel.org
Tue Oct 21 07:42:06 PDT 2025


On Tue, Oct 21, 2025 at 09:19:35AM +0200, Christoph Hellwig wrote:
> On Mon, Oct 20, 2025 at 11:24:44AM -0700, Keith Busch wrote:
> > From: Keith Busch <kbusch at kernel.org>
> > 
> > The dma_map_bvec helper doesn't work for p2p data. Rather than special
> > case it, just use the same mapping logic so that the driver doesn't need
> > to consider memory types.
> 
> We already consider the memory types for the data path, so treating the
> metadasta path where p2p is even more unlikely sounds like the wrong
> tradeoff.  

Maybe the data path should only use blk_dma_iter too. Is dma_map_bvec
that much faster for the single vector case? I'm going to test both on
real hardware and see if there's a difference in CPU utilization or
latency.

> If we have a single segment we just need a single
> is_pci_p2pdma_page check to skip direct mapping path.  Something like
> this untested patch:

The logic you used isn't accurate, but I know what you mean. I'll spin a
more minimal v2 patch.



More information about the Linux-nvme mailing list