public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] nvme: Refactor and expose per-controller timeout configuration
@ 2026-02-12 12:09 Maurizio Lombardi
  2026-02-12 12:09 ` [PATCH RFC 1/5] nvme: Let the blocklayer set timeouts for requests Maurizio Lombardi
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Maurizio Lombardi @ 2026-02-12 12:09 UTC (permalink / raw)
  To: kbusch; +Cc: mheyne, emilne, jmeneghi, linux-nvme, dwagner, mlombard

This patchset tries to address some limitations in how the NVMe driver handles
command timeouts.
Currently, the driver relies heavily on global module parameters
(NVME_IO_TIMEOUT and NVME_ADMIN_TIMEOUT), making it difficult for users to
tune timeouts for specific controllers that may have very different
characteristics. Also, in some cases, manual changes to sysfs timeout values
are ignored by the driver logic.

For example this patchset removes the unconditional timeout assignment in
nvme_init_request. This allows the block layer to correctly apply the request
queue's timeout settings, ensuring that user-initiated changes via sysfs
are actually respected for all requests.

It introduces new sysfs attributes (admin_timeout and io_timeout) to the NVMe
controller. This allows users to configure distinct timeout requirements for
different controllers rather than relying on global module parameters.

Some examples:

Changes to the controller's io_timeout gets propagated to all
the associated namespaces' queues:

# find /sys -name 'io_timeout' 
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n1/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n2/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n3/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/io_timeout

# echo 27000 > /sys/devices/virtual/nvme-fabrics/ctl/nvme0/io_timeout
# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n1/queue/io_timeout
27000
# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n2/queue/io_timeout
27000
# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n3/queue/io_timeout
27000

When adding a namespace target-side, the io_timeout is inherited from
the controller's preferred timeout:

* target side *
# nvmetcli
/> cd subsystems/test-nqn/namespaces/4 
/subsystems/t.../namespaces/4> enable
The Namespace has been enabled.

************

* Host-side *
nvme nvme0: rescanning namespaces.
# find /sys -name 'io_timeout' 
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n1/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n2/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n3/queue/io_timeout
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n4/queue/io_timeout <-- new namespace
/sys/devices/virtual/nvme-fabrics/ctl/nvme0/io_timeout

# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme0/nvme0c0n4/queue/io_timeout
27000
***********

io_timeout and admin_timeout module parameters are used as default
values for new controllers:

# nvme connect -t tcp -a 10.37.153.138 -s 8000 -n test-nqn2
connecting to device: nvme1

# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme1/nvme1c1n1/queue/io_timeout
30000
# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme1/admin_timeout
60000


David Jeffery (1):
  nvme: pci: use admin queue timeout over NVME_ADMIN_TIMEOUT

Heyne, Maximilian (1):
  nvme: Let the blocklayer set timeouts for requests

Maurizio Lombardi (3):
  nvme: add sysfs attribute to change admin timeout per nvme controller
  nvme: add sysfs attribute to change IO timeout per nvme controller
  nvme: use per controller timeout waits over depending on global
    default

 drivers/nvme/host/apple.c |  4 +--
 drivers/nvme/host/core.c  | 11 ++++---
 drivers/nvme/host/nvme.h  |  3 +-
 drivers/nvme/host/pci.c   |  5 +--
 drivers/nvme/host/rdma.c  |  2 +-
 drivers/nvme/host/sysfs.c | 69 +++++++++++++++++++++++++++++++++++++++
 drivers/nvme/host/tcp.c   |  2 +-
 7 files changed, 84 insertions(+), 12 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2026-02-23 10:42 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 12:09 [PATCH RFC 0/5] nvme: Refactor and expose per-controller timeout configuration Maurizio Lombardi
2026-02-12 12:09 ` [PATCH RFC 1/5] nvme: Let the blocklayer set timeouts for requests Maurizio Lombardi
2026-02-17 20:15   ` Mohamed Khalfella
2026-02-18 12:19     ` Heyne, Maximilian
2026-02-12 12:09 ` [PATCH RFC 2/5] nvme: add sysfs attribute to change admin timeout per nvme controller Maurizio Lombardi
2026-02-17 20:17   ` Mohamed Khalfella
2026-02-18 12:40   ` Heyne, Maximilian
2026-02-18 14:49     ` Maurizio Lombardi
2026-02-18 18:00   ` Mohamed Khalfella
2026-02-19 16:16     ` Maurizio Lombardi
2026-02-12 12:09 ` [PATCH RFC 3/5] nvme: pci: use admin queue timeout over NVME_ADMIN_TIMEOUT Maurizio Lombardi
2026-02-17 20:22   ` Mohamed Khalfella
2026-02-18 13:10   ` Heyne, Maximilian
2026-02-18 13:32     ` Maurizio Lombardi
2026-02-12 12:09 ` [PATCH RFC 4/5] nvme: add sysfs attribute to change IO timeout per nvme controller Maurizio Lombardi
2026-02-17 20:25   ` Mohamed Khalfella
2026-02-18 13:28     ` Maurizio Lombardi
2026-02-18 17:54       ` Mohamed Khalfella
2026-02-19 17:22         ` Maurizio Lombardi
2026-02-20 12:47           ` Maurizio Lombardi
2026-02-20 17:53             ` Mohamed Khalfella
2026-02-23 10:36               ` Maurizio Lombardi
2026-02-18 17:58   ` Mohamed Khalfella
2026-02-12 12:09 ` [PATCH RFC 5/5] nvme: use per controller timeout waits over depending on global default Maurizio Lombardi
2026-02-17 20:29   ` Mohamed Khalfella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox