Skip to content

blk-mq/nvme: improve nvme-pci reset handler

Ming Lei linux-block linux-nvme 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- give up after retrying enough times
- add comment on breaking because of shutdown

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3blk-mq: add API of blk_mq_queue_frozenblock/blk-mq.c include/linux/blk-mq.h+7 -00 replies
2/3nvme: add nvme_frozendrivers/nvme/host/core.c drivers/nvme/host/nvme.h+15 -00 replies
3/3nvme-pci: make nvme reset more reliabledrivers/nvme/host/core.c drivers/nvme/host/nvme.h drivers/nvme/host/pci.c+46 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/3] blk-mq/nvme: improve nvme-pci reset handler

Hi,

For nvme-pci, after controller is recovered, in-flight IOs are waited before updating nr hw queues. If new controller error happens during this period, nvme-pci driver deletes the controller and fails in-flight IO. This way is too violent, and not friendly from user viewpoint.

Add APIs for checking if queue is frozen, and replace nvme_wait_freeze in nvme-pci reset handler with checking if all ns queues are frozen & controller disabled. Then a fresh new reset can be scheduled for handling new controller error during waiting for in-flight IO completion.

So deleting controller & failing IOs can be avoided in this situation.

Without this patches, when fail io timeout injection is run, the controller can be removed very quickly. With this patch, no controller removing can be observed, and controller can recover to normal state after stopping to inject io timeout failure.

V2:
- give up after retrying enough times
- add comment on breaking because of shutdown

Ming Lei (3):
blk-mq: add API of blk_mq_queue_frozen
nvme: add nvme_frozen
nvme-pci: make nvme reset more reliable

 block/blk-mq.c           |  6 +++++
 drivers/nvme/host/core.c | 17 +++++++++++++-
 drivers/nvme/host/nvme.h |  3 +++
 drivers/nvme/host/pci.c  | 50 +++++++++++++++++++++++++++++++++-------
 include/linux/blk-mq.h   |  1 +
 5 files changed, 68 insertions(+), 9 deletions(-)
Cc Christoph Hellwig <[email protected]>
Cc Sagi Grimberg <[email protected]>
Cc Keith Busch <[email protected]>
Cc Max Gurtovoy <[email protected]>
Signature · 1 line
2.25.2