[PATCH v8 24/24] nvme-pci: optimize single-segment handling
Leon Romanovsky
leon at kernel.org
Tue Apr 22 00:44:19 PDT 2025
On Tue, Apr 22, 2025 at 06:39:56AM +0200, Christoph Hellwig wrote:
> On Fri, Apr 18, 2025 at 09:47:54AM +0300, Leon Romanovsky wrote:
> > From: Kanchan Joshi <joshi.k at samsung.com>
> >
> > blk_rq_dma_map API is costly for single-segment requests.
> > Avoid using it and map the bio_vec directly.
>
> This needs to be folded into the earlier patches or split prep patches
> instead of undoing work done earlier, preferably combined with a bit
> of code movement so that the new nvme_try_setup_prp_simple stays in
> the same place as before and the diff shows it reusing code.
>
> E.g. change
>
> "nvme-pci: use a better encoding for small prp pool allocations" to
> already use the flags instead of my boolean, and maybe include
> abort in the flags instead of using a separate bool so that we
> don't increase hte iod size.
>
> Slot in a new patch after that that dropping the single SGL segment
> fastpath if we think we don't need that, although if we need the PRP
> one I suspect that one would still be very helpful as well.
>
> Add a patch if we want the try_ version of, although when keeping
> the optimization for SGLs as well that are will look a bit different.
>
> I'm happy to give away my patch authorship credits if that helps with
> the folding.
I used this patch separation for two reasons:
1. Your conversion patch is absolutely correct and this patch is an
optimization.
2. Wanted to make sure that I'll post to the ML the code exactly as it
was tested.
I'll try to split/fold this patch now.
Thanks
More information about the Linux-nvme
mailing list