]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: Setup max hardware sector count to 512KB
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 10 Sep 2015 15:10:32 +0000 (08:10 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 10 Sep 2015 15:20:26 +0000 (08:20 -0700)
Linux in box NVMe driver does not handle 0 MDTS as expected
•0 MDTS - the drive can accept any request size.
•The device driver set up max hardware sector size by
BLK_SAFE_MAX_SECTORS or 124KB.
•Every IO size greater than 124KB is splitted by 124KB and remainder.

Hence performance drop at 128KB IO size.

Orabug: 21818316

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
drivers/block/nvme-core.c

index 244fda76b6891b25d11201688844fb6a862b17f0..b1b808cf375bcb66157e2234592b46eba28c9807 100644 (file)
@@ -2447,6 +2447,9 @@ static int nvme_dev_add(struct nvme_dev *dev)
        memcpy(dev->firmware_rev, ctrl->fr, sizeof(ctrl->fr));
        if (ctrl->mdts)
                dev->max_hw_sectors = 1 << (ctrl->mdts + shift - 9);
+       else
+                dev->max_hw_sectors = 512 * 1024 / 512;
+
        if ((pdev->vendor == PCI_VENDOR_ID_INTEL) &&
                        (pdev->device == 0x0953) && ctrl->vs[3]) {
                unsigned int max_hw_sectors;