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

Leon Romanovsky leon at kernel.org
Sun Oct 26 00:25:51 PDT 2025


On Tue, Oct 21, 2025 at 08:42:06AM -0600, Keith Busch wrote:
> 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.

We tried that path (remove special case for single segment), but for
very performance oriented case: direct mode without IOMMU, no p2p and
extremely powerful RAID (~94M IOPS), Jens and Kanchan saw performance
drop. On consumer grade HW (~2M IOPS), the performance change was not
noticed.

Thanks



More information about the Linux-nvme mailing list