]> 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)
commit481514380ae159bf92883b74c3e276b2f640cab9
treeacff2f2d7843fb0f2a3d8dfebc4642e0f67df63c
parent297f339f059684d6216e31db7383b9b60ce9473e
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