]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: only use power of two io boundaries
authorKeith Busch <kbusch@kernel.org>
Thu, 27 Aug 2020 17:38:57 +0000 (10:38 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Fri, 28 Aug 2020 23:43:57 +0000 (16:43 -0700)
commit66f8d98aa75ff334a9ca35af0d9646a466e974e7
treeacff2f2d7843fb0f2a3d8dfebc4642e0f67df63c
parent71a05ddc53c3b465160e2c92bac8abfc5e88f231
nvme: only use power of two io boundaries

The kernel requires a power of two for boundaries because that's the
only way it can efficiently split commands that cross them. A
controller, however, may report a non-power of two boundary.

The driver had been rounding the controller's value to one the kernel
can use, but splitting on the wrong boundary provides no benefit on the
device side, and incurs additional submission overhead from non-optimal
splits.

Don't provide any boundary hint if the controller's value can't be used
and log a warning when first scanning a disk's unreported IO boundary.
Since the chunk sector logic has grown, move it to a separate function.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c