OSDN Git Service

nvme-pci: place descriptor addresses in iod
authorKeith Busch <kbusch@kernel.org>
Thu, 5 Jan 2023 20:28:32 +0000 (12:28 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Feb 2023 13:21:59 +0000 (14:21 +0100)
commit7846c1b5a5db8bb8475603069df7c7af034fd081
tree9bdd09ef3bf986dcad6bc9f901c3515883204dbc
parentae5829350324a6bd93c1d9fc3ac67afc0c647e32
nvme-pci: place descriptor addresses in iod

The 'struct nvme_iod' space is appended at the end of the preallocated
'struct request', and padded to the cache line size. This leaves some
free memory (in most kernel configs) up for grabs.

Instead of appending the nvme data descriptor addresses after the
scatterlist, inline these for free within struct nvme_iod. There is now
enough space in the mempool for 128 possibe segments.

And without increasing the size of the preallocated requests, we can
hold up to 5 PRP descriptor elements, allowing the driver to increase
its max transfer size to 8MB.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c