nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset
authorKundan Kumar <kundan.kumar@samsung.com>
Thu, 23 May 2024 11:31:49 +0000 (17:01 +0530)
committerKeith Busch <kbusch@kernel.org>
Fri, 24 May 2024 15:59:16 +0000 (08:59 -0700)
commit1bd293fcf3af84674e82ed022c049491f3768840
tree92ec42c937a494bb535a61976a1182a1ee8c53f7
parent64e3d02b43b17390f0fa9af6708a4eafdf20ba01
nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset

bio_vec start offset may be relatively large particularly when large
folio gets added to the bio. A bigger offset will result in avoiding the
single-segment mapping optimization and end up using expensive
mempool_alloc further.

Rather than using absolute value, adjust bv_offset by
NVME_CTRL_PAGE_SIZE while checking if segment can be fitted into one/two
PRP entries.

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c