From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A117CCA9EAF for ; Sun, 27 Oct 2019 21:30:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74A0D205C9 for ; Sun, 27 Oct 2019 21:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572211857; bh=KllF1Vd9QjJ+moQw4J7Yv+052X+bzOtxMFBqtCgyhEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Q4Q45KvQm/zi/qgIhcBJDRoVC5ksaIm/xKqpI4liibmk9uJwTDf4RjLWBHzUsotQN oCkbrmS0PjEs4ADoN2HOETHTzneHtO0J5UD/ZkyYnyK+p0V/59iambAEX/WvL7uvhM 4hj3xJ8n0bOxEXvvKjsQpK2uz1Scuk8wmFab5Xr0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731189AbfJ0VSG (ORCPT ); Sun, 27 Oct 2019 17:18:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731205AbfJ0VSE (ORCPT ); Sun, 27 Oct 2019 17:18:04 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00939208C0; Sun, 27 Oct 2019 21:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572211083; bh=KllF1Vd9QjJ+moQw4J7Yv+052X+bzOtxMFBqtCgyhEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmSa8qLk0Mis/iN3/vLQd8zPuuN2homikEB/uIQJU/YHmhePo/2XBFRq+VHyViI/v z3PTckGXaAjCqdcz/WggfXWxNDiG8x6M268cgcuxCCquMuhSxhz+U/XgVujLMPg5cj kfr/G3whOcJW24FJBMKE8E+7hLedq0QFVqL2TPew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Dave Chinner , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , Damien Le Moal , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 5.3 026/197] blk-mq: honor IO scheduler for multiqueue devices Date: Sun, 27 Oct 2019 21:59:04 +0100 Message-Id: <20191027203353.126808171@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203351.684916567@linuxfoundation.org> References: <20191027203351.684916567@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ming Lei [ Upstream commit a12de1d42d74ef3c80e9fb9a2da94daaef747869 ] If a device is using multiple queues, the IO scheduler may be bypassed. This may hurt performance for some slow MQ devices, and it also breaks zoned devices which depend on mq-deadline for respecting the write order in one zone. Don't bypass io scheduler if we have one setup. This patch can double sequential write performance basically on MQ scsi_debug when mq-deadline is applied. Cc: Bart Van Assche Cc: Hannes Reinecke Cc: Dave Chinner Reviewed-by: Javier González Reviewed-by: Damien Le Moal Signed-off-by: Ming Lei Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index a79b9ad1aba18..ed41cde93641c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1998,6 +1998,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) } blk_add_rq_to_plug(plug, rq); + } else if (q->elevator) { + blk_mq_sched_insert_request(rq, false, true, true); } else if (plug && !blk_queue_nomerges(q)) { /* * We do limited plugging. If the bio can be merged, do that. @@ -2021,8 +2023,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_try_issue_directly(data.hctx, same_queue_rq, &cookie); } - } else if ((q->nr_hw_queues > 1 && is_sync) || (!q->elevator && - !data.hctx->dispatch_busy)) { + } else if ((q->nr_hw_queues > 1 && is_sync) || + !data.hctx->dispatch_busy) { blk_mq_try_issue_directly(data.hctx, rq, &cookie); } else { blk_mq_sched_insert_request(rq, false, true, true); -- 2.20.1