From patchwork Thu Jan 18 16:37:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10173691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5978E602DC for ; Thu, 18 Jan 2018 16:37:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CB8C26E47 for ; Thu, 18 Jan 2018 16:37:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40E8C283C3; Thu, 18 Jan 2018 16:37:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F8220572 for ; Thu, 18 Jan 2018 16:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbeARQhI (ORCPT ); Thu, 18 Jan 2018 11:37:08 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:54513 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbeARQhI (ORCPT ); Thu, 18 Jan 2018 11:37:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1516293428; x=1547829428; h=from:to:cc:subject:date:message-id; bh=jKQ8n4IAG7wZQGGLArbbYUfDmrotkquysWg4M2taCEc=; b=N2ZK3ZWfI0EFh4jzpf1bzG6BA/C2k4BGic9RFqH51G7u58PYTmTC67yj C9HBNuMvWLYio3c55sw26bLZaseeDDayQvwIrjnXqkD8o8BkhLa8NGL1a fS28DNm+HvPNGnA6k64bY+ClweyxGJH+WHoPDfQnw19R3IaGuvCDICXt8 cVRuzrGKkF5HjwJjS3ql4++eB8bEsVjS+OIAVGGG3T4tSJ6Z+3ey0mI8x CH44OO/EFz0VhqRgafCHaUFnI6GPgcYihdn6k6HqbwsroAORSdm0nJOHT rpesw+1HUzGtKMaExGPht27OmjepeJ1mzJUD6suT8OgBDy++3TwixWOBw Q==; X-IronPort-AV: E=Sophos;i="5.46,378,1511798400"; d="scan'208";a="172200624" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Jan 2018 00:37:07 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 18 Jan 2018 08:32:47 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 18 Jan 2018 08:37:08 -0800 From: Bart Van Assche To: Mike Snitzer Cc: dm-devel@redhat.com, linux-block@vger.kernel.org, Bart Van Assche , Ming Lei Subject: [PATCH] dm rq: Avoid that request processing stalls sporadically Date: Thu, 18 Jan 2018 08:37:07 -0800 Message-Id: <20180118163707.11825-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the .queue_rq() implementation of a block driver returns BLK_STS_RESOURCE then that block driver is responsible for rerunning the queue once the condition that caused it to return BLK_STS_RESOURCE has been cleared. The dm-mpath driver tells the dm core to requeue a request if e.g. not enough memory is available for cloning a request or if the underlying path is busy. Since the dm-mpath driver does not receive any kind of notification if the condition that caused it to return "requeue" is cleared, the only solution to avoid that dm-mpath request processing stalls is to call blk_mq_delay_run_hw_queue(). Hence this patch. Fixes: ec3eaf9a6731 ("dm mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE") Signed-off-by: Bart Van Assche Cc: Ming Lei --- drivers/md/dm-rq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index f16096af879a..c59c59cfd2a5 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -761,6 +761,7 @@ static blk_status_t dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx, /* Undo dm_start_request() before requeuing */ rq_end_stats(md, rq); rq_completed(md, rq_data_dir(rq), false); + blk_mq_delay_run_hw_queue(hctx, 100/*ms*/); return BLK_STS_RESOURCE; }