Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 14:29:28 +0100
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 14:29:54 +0100
commitbe0dac41217512ad9511e7165b12db1bd5734d7e (patch)
treef0495390a837df67a912113ba02af706030bf484
parent8e47e9297cc894c29107c63c8105d86f7492bd22 (diff)
libnvdimm, dimm: Maximize label transfer size (bsc#1111921,
bsc#1113408, FATE#326765, bsc#1113972).
-rw-r--r--patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch71
-rw-r--r--series.conf1
2 files changed, 72 insertions, 0 deletions
diff --git a/patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch b/patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch
new file mode 100644
index 0000000000..e1194a8b8b
--- /dev/null
+++ b/patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch
@@ -0,0 +1,71 @@
+From: Dan Williams <dan.j.williams@intel.com>
+Date: Wed, 10 Oct 2018 16:38:24 -0700
+Subject: libnvdimm, dimm: Maximize label transfer size
+Git-commit: d11cf4a7321b538563b0ab30dc0d1f18f9c56226
+Patch-mainline: v4.20-rc1
+References: bsc#1111921, bsc#1113408, FATE#326765, bsc#1113972
+
+Use kvzalloc() to bypass the arbitrary PAGE_SIZE limit of label transfer
+operations. Given the expense of calling into firmware, maximize the
+amount of label data we transfer per call to be up to the total label
+space if allowed by the firmware.
+
+Instead of limiting based on PAGE_SIZE we can instead simply limit the
+maximum size based on either the config_size int he case of the get
+operation, or the length of the write based on the set operation.
+
+On a system with 24 NVDIMM modules each with a config_size of 128K and a
+maximum transfer size of 64K - 4, this patch reduces the init time for the
+label data from around 24 seconds down to between 4-5 seconds.
+
+Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
+Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/nvdimm/dimm_devs.c | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+--- a/drivers/nvdimm/dimm_devs.c
++++ b/drivers/nvdimm/dimm_devs.c
+@@ -110,8 +110,8 @@ int nvdimm_init_config_data(struct nvdim
+ if (!ndd->data)
+ return -ENOMEM;
+
+- max_cmd_size = min_t(u32, PAGE_SIZE, ndd->nsarea.max_xfer);
+- cmd = kzalloc(max_cmd_size + sizeof(*cmd), GFP_KERNEL);
++ max_cmd_size = min_t(u32, ndd->nsarea.config_size, ndd->nsarea.max_xfer);
++ cmd = kvzalloc(max_cmd_size + sizeof(*cmd), GFP_KERNEL);
+ if (!cmd)
+ return -ENOMEM;
+
+@@ -133,7 +133,7 @@ int nvdimm_init_config_data(struct nvdim
+ memcpy(ndd->data + offset, cmd->out_buf, cmd->in_length);
+ }
+ dev_dbg(ndd->dev, "%s: len: %zu rc: %d\n", __func__, offset, rc);
+- kfree(cmd);
++ kvfree(cmd);
+
+ return rc;
+ }
+@@ -156,9 +156,8 @@ int nvdimm_set_config_data(struct nvdimm
+ if (offset + len > ndd->nsarea.config_size)
+ return -ENXIO;
+
+- max_cmd_size = min_t(u32, PAGE_SIZE, len);
+- max_cmd_size = min_t(u32, max_cmd_size, ndd->nsarea.max_xfer);
+- cmd = kzalloc(max_cmd_size + sizeof(*cmd) + sizeof(u32), GFP_KERNEL);
++ max_cmd_size = min_t(u32, len, ndd->nsarea.max_xfer);
++ cmd = kvzalloc(max_cmd_size + sizeof(*cmd) + sizeof(u32), GFP_KERNEL);
+ if (!cmd)
+ return -ENOMEM;
+
+@@ -182,7 +181,7 @@ int nvdimm_set_config_data(struct nvdimm
+ break;
+ }
+ }
+- kfree(cmd);
++ kvfree(cmd);
+
+ return rc;
+ }
diff --git a/series.conf b/series.conf
index cb678ca356..a2a6c144d0 100644
--- a/series.conf
+++ b/series.conf
@@ -18199,6 +18199,7 @@
patches.fixes/jbd2-fix-use-after-free-in-jbd2_log_do_checkpoint.patch
patches.fixes/Documentation-l1tf-Fix-small-spelling-typo.patch
patches.drivers/mfd-arizona-Correct-calling-of-runtime_put_sync.patch
+ patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch
patches.drivers/PCI-ASPM-Fix-link_state-teardown-on-device-removal.patch
patches.drivers/scsi-qla2xxx-Fix-process-response-queue-for-ISP26XX-.patch
patches.drivers/scsi-qla2xxx-Fix-incorrect-port-speed-being-set-for-.patch