Skip to content

blk-mq support for dm multipath

Keith Busch dm-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 9 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dm: prep initialized requestsblock/blk-core.c drivers/md/dm.c+1 -20 replies
2/4dm: Submit stacked requests in irq enabled contextdrivers/md/dm.c+28 -90 replies
3/4dm: Move request allocation to dm_target typedrivers/md/dm-mpath.c drivers/md/dm-target.c drivers/md/dm.c +1 more+82 -810 replies
4/4block: blk-mq support for cloned requestsblock/blk-core.c+5 -00 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCHv2 0/4] blk-mq support for dm multipath

This series makes device mapper's multipath work with both blk-mq and the older request_queue based block devices.

As before, I tested with a slightly modified version of Matias' blk-mq nvme driver with dual ported nvme controller. I'll post the nvme changes to that list once the blk-mq mpath is good to go.

I've tried to split this into logically separate patches to prep and support this request_queue type.

Patch [2/4] is a bit of a departure from what was done before, but I hope something like this is alright.

v1 -> v2:

Micro-optimization setting the cloned rq->bio to null from dm-mpath instead of blk_mq_rq_ctx_init.

There's no way around getting a request without calling blk_get_request. Making this API safe in an interrupt disabled context is troublesome, so submitting the dm request to the target in a different thread so it is NOT inline with dm's request_fn. We can use GFP_KERNEL now since the allocation occurs in this new context. I believe this is okay in both request queue types since neither allocate from general purpose memory.

In v1, the target would allocate the request and dm would release it. This duality is somewhat changed: the target's map_rq is still responsible to allocate since only it knows what request queue to allocate from, and I've added a new target type function (unmap_rq) to handle releasing.

I fixed the error handling; it was completely untested before and quite broken. To test, I synthesized 4 different errors: no requests available, no memory available to the clone bio, invalid target, and completing requests in low-level driver with an error. All worked as expected on blk-mq devices.

Keith Busch (4):
dm: prep initialized requests
dm: Submit stacked requests in irq enabled context
dm: Move request allocation to dm_target type
block: blk-mq support for cloned requests

 block/blk-core.c              |    7 +-
 drivers/md/dm-mpath.c         |   22 ++++--
 drivers/md/dm-target.c        |    9 ++-
 drivers/md/dm.c               |  155 +++++++++++++++++++++--------------------
 include/linux/device-mapper.h |    7 +-
 5 files changed, 112 insertions(+), 88 deletions(-)
Signature · 1 line
1.7.10.4