[SRU][T][PATCH 1/2] NVMe: Make I/O timeout a module parameter

Daniel Axtens daniel.axtens at canonical.com
Tue Nov 21 09:03:48 UTC 2017


From: Keith Busch <keith.busch at intel.com>

BugLink: https://bugs.launchpad.net/bugs/1729119

Increase the default timeout to 30 seconds to match SCSI.

Signed-off-by: Keith Busch <keith.busch at intel.com>
[use byte instead of ushort]
Signed-off-by: Matthew Wilcox <matthew.r.wilcox at intel.com>
(cherry picked from commit b355084a891985d4cd0ca23b1a83366af2c4232d)
Signed-off-by: Daniel Axtens <daniel.axtens at canonical.com>
---
 drivers/block/nvme-core.c | 4 ++++
 include/linux/nvme.h      | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 95a87b8f14bf..05357358c62f 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -55,6 +55,10 @@ static unsigned char shutdown_timeout = 5;
 module_param(shutdown_timeout, byte, 0644);
 MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown");
 
+unsigned char io_timeout = 30;
+module_param(io_timeout, byte, 0644);
+MODULE_PARM_DESC(io_timeout, "timeout in seconds for I/O");
+
 static int nvme_major;
 module_param(nvme_major, int, 0);
 
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f0f95c719685..cdccd015bdc3 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -66,7 +66,8 @@ enum {
 
 #define NVME_VS(major, minor)	(major << 16 | minor)
 
-#define NVME_IO_TIMEOUT	(5 * HZ)
+extern unsigned char io_timeout;
+#define NVME_IO_TIMEOUT	(io_timeout * HZ)
 
 /*
  * Represents an NVM Express device.  Each nvme_dev is a PCI function.
-- 
2.11.0





More information about the kernel-team mailing list