From patchwork Tue Sep 1 15:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 264726 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=-13.0 required=3.0 tests=BAYES_00,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=ham 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 D3201C433E6 for ; Tue, 1 Sep 2020 15:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A52CB21655 for ; Tue, 1 Sep 2020 15:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974795; bh=vzNBNtq1DCoZBAIMujwwjrAo0CYY6LBrr9qeIlp0IQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wHzrYBbmrvNXt4ZKF0en9wcubdLWx0f0X2LPrM8BZ/JhOiNnK4IxThlTWdsEWG3qj 52UY3E4zNGGvcoqNH0Mz8OOQKudwPpJIgB/m0j+nYt1tKB8SP8uQB+3q/Fi6LyIIkc 2PSaZ0z+rdSv+4XF8QSr205bk1JY7rG8Mbn8YY6g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728924AbgIAPjv (ORCPT ); Tue, 1 Sep 2020 11:39:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:50222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731478AbgIAPju (ORCPT ); Tue, 1 Sep 2020 11:39:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 60C0C20866; Tue, 1 Sep 2020 15:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974790; bh=vzNBNtq1DCoZBAIMujwwjrAo0CYY6LBrr9qeIlp0IQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZUO4eGge5TNFd1jxF4/JcJ0dopVFx9v3Moj2usxcLksIJQL2D10XEOTDmaIxIuDeI eEdUYgzG6hYM0tvbP5WljXW8QOotd0mS8vBoF2PdV7vtFL/BMGcQhrwptSSVX/Wehk vUrR0xlLoO/8MPyfRAbXYVx3u62XAgJ2rTwaou5s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Christoph Hellwig , Bart Van Assche , Mike Snitzer , Jens Axboe , Sasha Levin Subject: [PATCH 5.8 092/255] blk-mq: insert request not through ->queue_rq into sw/scheduler queue Date: Tue, 1 Sep 2020 17:09:08 +0200 Message-Id: <20200901151005.133336204@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ming Lei [ Upstream commit db03f88fae8a2c8007caafa70287798817df2875 ] c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list") supposed to add request which has been through ->queue_rq() to the hw queue dispatch list, however it adds request running out of budget or driver tag to hw queue too. This way basically bypasses request merge, and causes too many request dispatched to LLD, and system% is unnecessary increased. Fixes this issue by adding request not through ->queue_rq into sw/scheduler queue, and this way is safe because no ->queue_rq is called on this request yet. High %system can be observed on Azure storvsc device, and even soft lock is observed. This patch reduces %system during heavy sequential IO, meantime decreases soft lockup risk. Fixes: c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list") Signed-off-by: Ming Lei Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Mike Snitzer Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 4e0d173beaa35..e86ccfe377779 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1909,7 +1909,8 @@ insert: if (bypass_insert) return BLK_STS_RESOURCE; - blk_mq_request_bypass_insert(rq, false, run_queue); + blk_mq_sched_insert_request(rq, false, run_queue, false); + return BLK_STS_OK; }