From patchwork Tue Sep 1 15:09:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 310316 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=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 60418C433E7 for ; Tue, 1 Sep 2020 16:35:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3332E2065F for ; Tue, 1 Sep 2020 16:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598978111; bh=iHraPqcWIuC6KUiwWwCGn2hqCPFfZxVGTyd79HTIvtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=STA4nUz9+mTizwMCd2KSA0Ab/PoSZt+VSHcJjCpXrYrlH3Uw3RtuPIrUWM+JvlUeY EPNgKqxavCG/Mw1Si45Tx36niz9oAqsdx2lw2TSSiYIUaSeBkr1cTzlVfA8YK2yGzT MvE6G2Lg2nJy47JhmCYsqIG7Fperl8jKD2KgLJPo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730641AbgIAPa4 (ORCPT ); Tue, 1 Sep 2020 11:30:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730635AbgIAPaz (ORCPT ); Tue, 1 Sep 2020 11:30:55 -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 C49BE20FC3; Tue, 1 Sep 2020 15:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974252; bh=iHraPqcWIuC6KUiwWwCGn2hqCPFfZxVGTyd79HTIvtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=akDXqimAjwnJen8vguT3ReJ76uulIFtNp2j9f4VsuMJ/LMsC5+TOjxIi4+6i0FnrF on528O/XAdvabPf/EBdXnAbJ0j67mk8NitGBIG1x/z6y3IueAU6D76Q76TArtIrwKk 6axX6iMi9aBqjPcgWoP0qJJVuQKEdYV14nIz3D0c= 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.4 105/214] blk-mq: insert request not through ->queue_rq into sw/scheduler queue Date: Tue, 1 Sep 2020 17:09:45 +0200 Message-Id: <20200901150958.018897922@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150952.963606936@linuxfoundation.org> References: <20200901150952.963606936@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 ae7d31cb5a4e1..8f67f0f16ec2e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1869,7 +1869,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; }