Skip to content

blk-mq: wait until completed req's complete fn is run

Ming Lei linux-block linux-nvme 2 versions – Applied

Status from this message: Queued up for 5.4, thanks Ming.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 5 repliesApplied
  2. v15 patches 19 repliesSuperseded

Changes in v2 from the cover letter

- fix one build warning
- fix commit log
- apply the wait on nvme-fc code too

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5blk-mq: introduce blk_mq_request_completed()block/blk-mq.c include/linux/blk-mq.h+7 -00 replies
2/5blk-mq: introduce blk_mq_tagset_wait_completed_request()block/blk-mq-tag.c include/linux/blk-mq.h+33 -00 replies
3/5nvme: don't abort completed request in nvme_cancel_requestdrivers/nvme/host/core.c+4 -00 replies
4/5nvme: wait until all completed request's complete fn is calleddrivers/nvme/host/fc.c drivers/nvme/host/pci.c drivers/nvme/host/rdma.c +2 more+18 -40 replies
5/5blk-mq: remove blk_mq_complete_request_syncblock/blk-mq.c drivers/nvme/host/core.c include/linux/blk-mq.h+1 -90 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchSagi Grimberg
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 0/5] blk-mq: wait until completed req's complete fn is run

Hi,

blk-mq may schedule to call queue's complete function on remote CPU via IPI, but never provide any way to synchronize the request's complete fn.

In some driver's EH(such as NVMe), hardware queue's resource may be freed & re-allocated. If the completed request's complete fn is run finally after the hardware queue's resource is released, kernel crash will be triggered.

Fixes this issue by waitting until completed req's complete fn is run.

V2:
- fix one build warning
- fix commit log
- apply the wait on nvme-fc code too

Thanks,
Ming

Ming Lei (5):
blk-mq: introduce blk_mq_request_completed()
blk-mq: introduce blk_mq_tagset_wait_completed_request()
nvme: don't abort completed request in nvme_cancel_request
nvme: wait until all completed request's complete fn is called
blk-mq: remove blk_mq_complete_request_sync

 block/blk-mq-tag.c         | 32 ++++++++++++++++++++++++++++++++
 block/blk-mq.c             | 13 ++++++-------
 drivers/nvme/host/core.c   |  6 +++++-
 drivers/nvme/host/fc.c     |  2 ++
 drivers/nvme/host/pci.c    |  2 ++
 drivers/nvme/host/rdma.c   |  8 ++++++--
 drivers/nvme/host/tcp.c    |  8 ++++++--
 drivers/nvme/target/loop.c |  2 ++
 include/linux/blk-mq.h     |  3 ++-
 9 files changed, 63 insertions(+), 13 deletions(-)
Cc Max Gurtovoy <maxg at mellanox.com>
Cc Sagi Grimberg <sagi at grimberg.me>
Cc Keith Busch <keith.busch at intel.com>
Cc Christoph Hellwig <hch at lst.de>
Signature · 1 line
2.20.1