Skip to content
Commit 62fc41a6 authored by Kundan Kumar's avatar Kundan Kumar Committed by Greg Kroah-Hartman
Browse files

nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset

[ Upstream commit 1bd293fc

 ]

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKundan Kumar <kundan.kumar@samsung.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ce39d857
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment