On Wed, 2019-03-27 at 18:00 -0400, Laurence Oberman wrote: +AD4 Hello Jens, Jianchao +AD4 Finally made it to this one. +AD4 I will see if I can revert and test +AD4 +AD4 7f556a44e61d0b62d78db9a2662a5f0daef010f2 is the first bad commit +AD4 commit 7f556a44e61d0b62d78db9a2662a5f0daef010f2 +AD4 Author: Jianchao Wang +ADw-jianchao.w.wang+AEA-oracle.com+AD4 +AD4 Date: Fri Dec 14 09:28:18 2018 +-0800 +AD4 +AD4 blk-mq: refactor the code of issue request directly +AD4 +AD4 Merge blk+AF8-mq+AF8-try+AF8-issue+AF8-directly and +AF8AXw-blk+AF8-mq+AF8-try+AF8-issue+AF8-directly +AD4 into one interface to unify the interfaces to issue requests +AD4 directly. The merged interface takes over the requests totally, +AD4 it could insert, end or do nothing based on the return value of +AD4 .queue+AF8-rq and 'bypass' parameter. Then caller needn't any other +AD4 handling any more and then code could be cleaned up. +AD4 +AD4 And also the commit c616cbee ( blk-mq: punt failed direct issue +AD4 to dispatch list ) always inserts requests to hctx dispatch list +AD4 whenever get a BLK+AF8-STS+AF8-RESOURCE or BLK+AF8-STS+AF8-DEV+AF8-RESOURCE, this is +AD4 overkill and will harm the merging. We just need to do that for +AD4 the requests that has been through .queue+AF8-rq. This patch also +AD4 could fix this. +AD4 +AD4 Signed-off-by: Jianchao Wang +ADw-jianchao.w.wang+AEA-oracle.com+AD4 +AD4 Signed-off-by: Jens Axboe +ADw-axboe+AEA-kernel.dk+AD4 Hi Laurence, I have not been able to reproduce this issue. But you may want to try the following patch (applies on top of v5.1-rc3): Subject: +AFs-PATCH+AF0 block: Fix blk+AF8-mq+AF8-try+AF8-issue+AF8-directly() If blk+AF8-mq+AF8-try+AF8-issue+AF8-directly() returns BLK+AF8-STS+ACoAXw-RESOURCE that means that the request has not been queued and that the caller should retry to submit the request. Both blk+AF8-mq+AF8-request+AF8-bypass+AF8-insert() and blk+AF8-mq+AF8-sched+AF8-insert+AF8-request() guarantee that a request will be processed. Hence return BLK+AF8-STS+AF8-OK if one of these functions is called. This patch avoids that blk+AF8-mq+AF8-dispatch+AF8-rq+AF8-list() crashes when using dm-mpath. Reported-by: Laurence Oberman +ADw-loberman+AEA-redhat.com+AD4 Fixes: 7f556a44e61d (+ACI-blk-mq: refactor the code of issue request directly+ACI) +ACM v5.0. Signed-off-by: Bart Van Assche +ADw-bvanassche+AEA-acm.org+AD4 --- block/blk-mq.c +AHw 9 +-+-------- 1 file changed, 2 insertions(+-), 7 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 652d0c6d5945..b2c20dce8a30 100644 --- a/block/blk-mq.c +-+-+- b/block/blk-mq.c +AEAAQA -1859,16 +-1859,11 +AEAAQA blk+AF8-status+AF8-t blk+AF8-mq+AF8-try+AF8-issue+AF8-directly(struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-hctx, case BLK+AF8-STS+AF8-RESOURCE: if (force) +AHs blk+AF8-mq+AF8-request+AF8-bypass+AF8-insert(rq, run+AF8-queue)+ADs - /+ACo - +ACo We have to return BLK+AF8-STS+AF8-OK for the DM - +ACo to avoid livelock. Otherwise, we return - +ACo the real result to indicate whether the - +ACo request is direct-issued successfully. - +ACo-/ - ret +AD0 bypass ? BLK+AF8-STS+AF8-OK : ret+ADs +- ret +AD0 BLK+AF8-STS+AF8-OK+ADs +AH0 else if (+ACE-bypass) +AHs blk+AF8-mq+AF8-sched+AF8-insert+AF8-request(rq, false, run+AF8-queue, false)+ADs +- ret +AD0 BLK+AF8-STS+AF8-OK+ADs +AH0 break+ADs default: Thanks, Bart.