[PATCH 5/7] nvme-pci: use a better encoding for small prp pool allocations

Christoph Hellwig hch at lst.de
Tue May 13 22:12:21 PDT 2025


On Tue, May 13, 2025 at 09:06:38AM -0600, Keith Busch wrote:
> >  		if (i == NVME_CTRL_PAGE_SIZE >> 3) {
> >  			__le64 *old_prp_list = prp_list;
> > -			prp_list = dma_pool_alloc(pool, GFP_ATOMIC, &prp_dma);
> > +
> > +			prp_list = dma_pool_alloc(nvme_dma_pool(nvmeq, iod),
> > +					GFP_ATOMIC, &prp_dma);
> 
> You could assume nvmeq->descriptor_pools.large here. We'd never use the
> small pool if we've enough elements to chain lists, and it would skip
> the extra condition branch on each loop.

Yeah, I'll fix it up.

Something only vaguely related:  do you remember why the metadata SGL
descriptors are limited to just the small pool?  It would be nice
to support as many metadata as data entries, which we'd almost get
by using the larger one (we'd still be one off).




More information about the Linux-nvme mailing list