From patchwork Thu Apr 6 18:10:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9668025 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 1B58A60365 for ; Thu, 6 Apr 2017 18:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EB25285B7 for ; Thu, 6 Apr 2017 18:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33A24285BC; Thu, 6 Apr 2017 18:11:11 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 877A3285BB for ; Thu, 6 Apr 2017 18:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276AbdDFSLJ (ORCPT ); Thu, 6 Apr 2017 14:11:09 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:8870 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752831AbdDFSLF (ORCPT ); Thu, 6 Apr 2017 14:11:05 -0400 X-IronPort-AV: E=Sophos;i="5.37,160,1488816000"; d="scan'208";a="9115767" Received: from mail-cys01nam02lp0054.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.54]) by ob1.hgst.iphmx.com with ESMTP; 07 Apr 2017 02:11:02 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aYb48nhh3xf4280Lxw2vwuL1r3ZBvInagBgt8k2Ws3g=; b=ZE9Czg+T88gFggtNQw6ikupUFgd6B6KTuOdXKzIaKVrQbEQzwkq5wMA9dLM/D/UGc0MqLNrFYmuUXozd+k/ziV59r2evEFVV9I9t1orZREz2JkBz1ALb/tSshxJiwLJF/wcV2DkfQkW94pBZCzKsWjhNMwiHslvjxP2rCHrj/3k= Received: from CO2PR04CA0081.namprd04.prod.outlook.com (10.166.88.49) by BL2PR04MB100.namprd04.prod.outlook.com (10.255.231.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 6 Apr 2017 18:11:00 +0000 Received: from SN1NAM04FT053.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::200) by CO2PR04CA0081.outlook.office365.com (2603:10b6:102:1::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Thu, 6 Apr 2017 18:10:59 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; kernel.dk; dkim=none (message not signed) header.d=none;kernel.dk; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by SN1NAM04FT053.mail.protection.outlook.com (10.152.88.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1019.14 via Frontend Transport; Thu, 6 Apr 2017 18:10:58 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id A2.01.19026.1B486E85; Thu, 6 Apr 2017 11:10:57 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Thu, 6 Apr 2017 11:10:53 -0700 X-AuditID: 0ac94371-41ba798000004a52-42-58e684b1041d Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 67.8A.18148.DA486E85; Thu, 6 Apr 2017 11:10:53 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Bart Van Assche , Christoph Hellwig , Hannes Reinecke Subject: [PATCH v3 2/5] blk-mq: Restart a single queue if tag sets are shared Date: Thu, 6 Apr 2017 11:10:47 -0700 Message-ID: <20170406181050.12137-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170406181050.12137-1-bart.vanassche@sandisk.com> References: <20170406181050.12137-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsXCddJ5ke7GlmcRBtNXalmsvtvPZrHgzV42 i5WrjzJZ7L2l7cDicflsqcfumw1sHuu3XGXx+LxJLoAlissmJTUnsyy1SN8ugSvj6blW1oI2 g4o3azqYGxgvq3cxcnJICJhIPP62mKWLkYtDSGApk8TFKafZIZztjBLzjq5jhama8+gcM0Ri I6NEx8L9bCAJNgEjiW/vZ7KA2CICChI9v1eygRQxC0xhlDh3fwvQKA4OYQFfiRv7DUBqWARU JCb3LwcbyitgL9G98z8TxAJ5iUWbZoDN4RRwkHh48jATSKsQUM3vNW4gIyUE2lgl7kzoZ4To FZQ4OfMJWD2zgITEwRcvmEFsIQF1iZNL5jNNYBSahaRsFpKyBYxMqxjFcjNzinPTUwsMTfSK E/NSMouz9ZLzczcxQsK6cAfj69vehxgFOBiVeHg9Hj+JEGJNLCuuzD3EKMHBrCTCm1b/LEKI NyWxsiq1KD++qDQntfgQozQHi5I4b5bs1AghgfTEktTs1NSC1CKYLBMHp1QDI5vsmfz4CXd2 rmf8nHmKd388d63xiSa1DwzShzNv3DfSCTqm+WLCfuf+1y9vuAiJX30lufvXMrMbyazBAXk+ /19LqP+6VpoSeub091u1L5Q6rZ6kPNevEAlWPyTT3uKsVnRr+vPbh6+n886TPMh67gVv57+a XsmgefH3syZsdPsx3612/vNV15RYijMSDbWYi4oTAXiwnH1nAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJMWRmVeSWpSXmKPExsXCtZGTTXdty7MIg44F1har7/azWRz82cZo seDNXjaLlauPMlnsvaXtwOpx+Wypx+6bDWwe09acZ/JYv+Uqi8fnTXIBrFFcNimpOZllqUX6 dglcGU/PtbIWtBlUvFnTwdzAeFm9i5GTQ0LARGLOo3PMXYxcHEIC6xklfv2/wQiSYBMwkvj2 fiYLiC0ioCDR83slG0gRs8AURomlLz4AORwcwgK+Ejf2G4DUsAioSmx9PYsVxOYVsJf4OP87 O8QCeYlFm2aAzeEUcJB4ePIwE0irEFDN7zVuExi5FzAyrGIUy83MKc5NzywwNNIrTsxLySzO 1kvOz93ECAmGqB2M1yeaH2Jk4uCUamDMW20q9T8n6Wqqw/ZcvbIUNp5L0a4WDVUcif+VTxW6 7Z3+O5W16mSWgGzskqvnFzdtM5yf/nK9wJWJlh9+aR0VzrmvvrujK3rh1kX/V/OavJJYx9F8 7kDnxm+edkeXvttXfVowqeH0wlnbeVjj6+K2BAcIr6nqlHvGd3taULHrsb9fz5q4vVJWYinO SDTUYi4qTgQAe9sTCLYBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39860400002)(39400400002)(39840400002)(39450400003)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(76176999)(50986999)(53936002)(106466001)(86362001)(36756003)(1076002)(54906002)(33646002)(77096006)(110136004)(38730400002)(47776003)(5660300001)(50466002)(5003940100001)(48376002)(8676002)(81166006)(50226002)(8936002)(2950100002)(2906002)(6916009)(189998001)(6666003)(356003)(305945005)(4326008); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB100; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT053; 1:h6+qLBhjR40PnVX9uGaNb0AtGskiLpyipsqgxfMwsH3ZOppra1S63DpWCVFoQ9K8YOOVvFpjlkKsNi5/RdPx02+p7QdWdoE9wymsfzFVBjefogEwY2+5FhHRWZ3TACAC+7XGijnhFpX7apZngB85CgF4tCs2R+jEuY+gBt3CkOFR36kEFZoZSw2ispLZe3k4fGU0P9VG/JRBFyleoRq5wFtvqAp9K75v/bOMPLwxttj7mTnDWW/d/dwvCtk/TG28eGz2p1Ji+5zOIWL94tsp6P17RwyjAeb83kwT8eueUDF7jQz8X49Ej4/uJysC3SoJkTbNk9oQPVfnpneGRUG4j/1acXKgzaAAqZ3UkPJGyQjP2CJcefFmRc2BMwnu4412ewkmxbbcuMrCeVtTNm08DeyqGPPxfaTDyxOLtKrcWk313hxPw/i549cxDAnBvx9xUq5Z1qtYa+ylBpJ1Mi12mYVt+BiR/vLVfiufCc/kE7/ovnAD+ewSlml4yrFgN6nT X-MS-Office365-Filtering-Correlation-Id: af421f1f-2a41-414a-03e7-08d47d184721 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BL2PR04MB100; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB100; 3:bNkGxZULphOOX7IiFqmqYUc0sL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L8LDscBOlqiSJXITSn6uvlC92qtE2jfYhDIRl3RoFqGKH2AiL7uSPIpFmM3jITDCQk2Z8czsklyslUSORie1+ThDc2cHUMgTjwH4ypukDmug+hNyoy40iNDiVDF7bSynXD8CLR3pxwEd56Y0ONcnp7IjEHCuQuoFf2/Q+9qWHRQ0Y1v9FsoJzCSiiP/O7HF6qw== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB100; 20:WG6tlPzzkgJ1jHjDg/sghAZ4zDIiXGChpAMMdGHYGUyKyKyuGtncuRTRue0hKK9v13lCFZGOBOmC7p4dPSDMw0Qr7ej/G3npucq4J6Fuz6LUtlZUZXO7F7uU3CCRZKLHdNl6jSABkJJGOVSqyVilN1/Rh6Q0Y0N7OkpM2hvGRvVg66vSXCavY8xUyGpOIY487F5CbazCnAgXb5+hPwIChu8fKjMxrNx/QXdphcRhMf6MrM/+Gvt6VExnK78a+3o3894TqHpnJbVASfMI2MfzaEIb5PwgmwfEgqY05/shXzKlLOYHjjK7YCsDC/Asfpiij2q5vJcxsMF2pltijisaqUw2+Bcff6eJEIODARB2+fl2IXyCHwC415VkCaFpWAQkPujZ5aX9RS2e20xfYdQkVJeMg65flSSgwPPYdFE35dRILvQs2koWASvUSbHJIcHx5DHfqLZXxViJ7qdjtQBMPDvmEEOoNwD7wKDLNDkoBkDE6HOUTuEunMdDwj15tNd8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148); SRVR:BL2PR04MB100; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB100; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB100; 4://mHB5o/fhI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HqznZn?= =?us-ascii?Q?nXEQwCSAGAS5aUdObZP1W/p9l7MSWOlX00AzRk/vaefdfn+YTHXJMvcglOQt?= =?us-ascii?Q?tlaN+jQNlhViLAwu/vDm0morR5/Qrzth5H6cyU3GvRC87WYBaGnYmJoQ4veS?= =?us-ascii?Q?QasZeyUNOp6SBQteekD4FGtESslJJnljQc2O4Gnl9prnPRLWoq+MbEGW5vLd?= =?us-ascii?Q?mWc7mxsFglBziV66t24GqlzPeefKqE1SmXIRa3/PM+svm6q4gzMfWGrtVEGx?= =?us-ascii?Q?pE7SXk0tLsQkb0yA9ZbdWOqykW/+zkpmHegQNMJ2dkmI7Ut90+dZjWJZw+v/?= =?us-ascii?Q?Fh8FRL89oWED30AMbIoOHID4+C/7O06ip17RC1J2OjDfCx6DqqPBD93a9JVi?= =?us-ascii?Q?7i5affPpsuQdmwF/p+IQ1rZayp5Dih6wBGmnDJdpUinNXOaoUszIHt+eZgBc?= =?us-ascii?Q?mL2sWLzoTO/xERtkrbDu8ukaFY+vU3RUmvMxnnnLfOPsej2Q+ukvlCr1exGf?= =?us-ascii?Q?0yr/AOTeIfM6Up/5Yx4EqvvtaIN9czBInqs8KoH9E6a7sjraTypBntwCZ54z?= =?us-ascii?Q?j48iSEGX43LCJS9voYibuKrNdUpwIfZDj/TH39RSBMTrUlRt3rZpBQdyc/be?= =?us-ascii?Q?Tuzt82GjshELp2be2QupR6zAdwI2EmbnntxV9vQzr80e129HVLvg1R5mq7o7?= =?us-ascii?Q?TiCnAOvg7kIEyuxUC3HNoROhPXQIW49IPk6qPnQBKqD6ATV+idn7LoozwD6F?= =?us-ascii?Q?4V6l++Tq/CN7zVSTRldc1NpTix6AvsQgkVbdPZdL5r68UJd7RcUeu7TiEPIg?= =?us-ascii?Q?bgyFwAQDobTTwafHpbc2WcW32++HVoxRJbqASTeBXdFGTKJaXwch1V2Ofb8Z?= =?us-ascii?Q?DXn3corMnSY2JPE3fOrCGIFpO/WvTmoIflYhJC/dpU2g=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB100; 6:5LlL7CNo1nyu4azFuMlDUMdEnvQwDHjYMuP6DqijgREHmePWSizSD5OdA456r7OI7zNSkRfUBBz6j3BdUVDto6WJQ5wUNA1Irnf7WT82RlbVwQlBqib6BM2IQTXop9lRrel+hzqKrZzlqG1g69e11aH5MMWIMT3tE1VvyNMx0fYREnPreOzAq2clxgyOVBITMj8+B0rUUoAA6bKWmXCpAi3w9xuNckvNnvAr8LAw3flrMVdGQVL8cy54hGU+OJrUiEDNmbPnEHRclPknGod71LZfdgnSV6oYh+WUtBm0nIvn3tg+IyJ8jwqnxwm2zY/xTdirEE9Zp5oEpBqaOvfBAud9J7ADVxbUVeVUUfWpe60BZ2Ov3IigcFqZTk4xA4QRbnQzKViPxlGBaTF3P7L0/fW523ufFhXfHQgeciwPEIg=; 5:YCvlhp0zeSatTaJdGayHrmWkOQszsBj2LXaYkOMsTwBS61uB2ztvU+ZkUr51EDxPCuZcQXGDdF2Ip3/SgJMkVhcb0csv6mJ5KSbgFEBVHb1/yVOSTldJ0khjBiGCUGzYoY2If1nyITqE+7MjmLrLYQ==; 24:NMQJd/TYSPkoDNWi/T+RbmJb63GxyCvhdmpvLx7rsmqZoMwWmWHvIuQ/DB7qw6YZTUM8ZvCAOLmGT0T8qWCgY1hkxWGa9QlJRbA9KZwj2/I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB100; 7:Za6Y32f5m/S6syBXDAiJU+90inzcNp8AZluUrLm+LDzMCb/WOdQrAiFLdLVrOCiZJhodIuxqOl6KRO8njq2SIP+hSn24dA8CMcYmC7qLJeRaksmtH1fxfd9YvLPaehX7AM09Vyni1GLN524SODtU0EaoXjrbEC+UBLfYojlMbtUpG4nD6KLUnyvJCMvlXlIwvpAhHwxIck/qDpTO75a6sm0SE3acogRcvjqQUGNRpHD7jmL6FQXeS0KRQATBnT5satyQ9yU7eL9dottQpzDo1yJIKU0Oqo4Sg8T2OaNgtB0Fwerh8S0wH4VbL7nUiyXqYjBEDwk9WF/Z4rJYVJ7gtw==; 20:v8wH8L5HPLt6ousQ4aNHEqSfv9Cb8Mcq28f7goLhG/fOhcm6YenVWS7wbDLECK1Aaac4PL8qGDNixgXMWuorXU9wiUJraHvqVpN+h78NarDvPsXqZlfZgdhMyW2KtW7jspb7BvWGBHHz+y850gDG68OERQtcaJLjU4tBVUsthR0= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2017 18:10:58.8209 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB100 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 To improve scalability, if hardware queues are shared, restart a single hardware queue in round-robin fashion. Rename blk_mq_sched_restart_queues() to reflect the new semantics. Remove blk_mq_sched_mark_restart_queue() because this function has no callers. Remove flag QUEUE_FLAG_RESTART because this patch removes the code that uses this flag. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke --- block/blk-mq-sched.c | 60 +++++++++++++++++++++++++++++++++++++++++--------- block/blk-mq-sched.h | 16 +------------- block/blk-mq.c | 2 +- include/linux/blkdev.h | 1 - 4 files changed, 52 insertions(+), 27 deletions(-) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 09af8ff18719..8f553775d3ed 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -317,25 +317,65 @@ static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx, return true; } -static void blk_mq_sched_restart_hctx(struct blk_mq_hw_ctx *hctx) +static bool blk_mq_sched_restart_hctx(struct blk_mq_hw_ctx *hctx) { if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) { clear_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); - if (blk_mq_hctx_has_pending(hctx)) + if (blk_mq_hctx_has_pending(hctx)) { blk_mq_run_hw_queue(hctx, true); + return true; + } } + return false; } -void blk_mq_sched_restart_queues(struct blk_mq_hw_ctx *hctx) +/** + * list_for_each_entry_rcu_rr - iterate in a round-robin fashion over rcu list + * @pos: loop cursor. + * @skip: the list element that will not be examined. Iteration starts at + * @skip->next. + * @head: head of the list to examine. This list must have at least one + * element, namely @skip. + * @member: name of the list_head structure within typeof(*pos). + */ +#define list_for_each_entry_rcu_rr(pos, skip, head, member) \ + for ((pos) = (skip); \ + (pos = (pos)->member.next != (head) ? list_entry_rcu( \ + (pos)->member.next, typeof(*pos), member) : \ + list_entry_rcu((pos)->member.next->next, typeof(*pos), member)), \ + (pos) != (skip); ) + +/** + * Called after a driver tag has been freed to check whether a hctx needs to + * be restarted. Restarts @hctx if its tag set is not shared. Restarts hardware + * queues in a round-robin fashion if the tag set of @hctx is shared with other + * hardware queues. + */ +void blk_mq_sched_restart(struct blk_mq_hw_ctx *const hctx) { - struct request_queue *q = hctx->queue; - unsigned int i; - - if (test_bit(QUEUE_FLAG_RESTART, &q->queue_flags)) { - if (test_and_clear_bit(QUEUE_FLAG_RESTART, &q->queue_flags)) { - queue_for_each_hw_ctx(q, hctx, i) - blk_mq_sched_restart_hctx(hctx); + struct blk_mq_tags *const tags = hctx->tags; + struct blk_mq_tag_set *const set = hctx->queue->tag_set; + struct request_queue *const queue = hctx->queue, *q; + struct blk_mq_hw_ctx *h; + unsigned int i, j; + + if (set->flags & BLK_MQ_F_TAG_SHARED) { + rcu_read_lock(); + list_for_each_entry_rcu_rr(q, queue, &set->tag_list, + tag_set_list) { + queue_for_each_hw_ctx(q, h, i) + if (h->tags == tags && + blk_mq_sched_restart_hctx(h)) + goto done; + } + for (i = 0; i < queue->nr_hw_queues; i++) { + j = (i + hctx->queue_num + 1) % queue->nr_hw_queues; + h = queue->queue_hw_ctx[j]; + if (h->tags == tags && blk_mq_sched_restart_hctx(h)) + break; } +done: + rcu_read_unlock(); } else { blk_mq_sched_restart_hctx(hctx); } diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index a75b16b123f7..4e3fc2a40207 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -19,7 +19,7 @@ bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio, struct request **merged_request); bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio); bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq); -void blk_mq_sched_restart_queues(struct blk_mq_hw_ctx *hctx); +void blk_mq_sched_restart(struct blk_mq_hw_ctx *hctx); void blk_mq_sched_insert_request(struct request *rq, bool at_head, bool run_queue, bool async, bool can_block); @@ -131,20 +131,6 @@ static inline void blk_mq_sched_mark_restart_hctx(struct blk_mq_hw_ctx *hctx) set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); } -/* - * Mark a hardware queue and the request queue it belongs to as needing a - * restart. - */ -static inline void blk_mq_sched_mark_restart_queue(struct blk_mq_hw_ctx *hctx) -{ - struct request_queue *q = hctx->queue; - - if (!test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) - set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); - if (!test_bit(QUEUE_FLAG_RESTART, &q->queue_flags)) - set_bit(QUEUE_FLAG_RESTART, &q->queue_flags); -} - static inline bool blk_mq_sched_needs_restart(struct blk_mq_hw_ctx *hctx) { return test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); diff --git a/block/blk-mq.c b/block/blk-mq.c index b5580b09b4a5..dc83aec338d9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -351,7 +351,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx, blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag); if (sched_tag != -1) blk_mq_sched_completed_request(hctx, rq); - blk_mq_sched_restart_queues(hctx); + blk_mq_sched_restart(hctx); blk_queue_exit(q); } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3cf241b0814d..dc6c8d39d462 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -615,7 +615,6 @@ struct request_queue { #define QUEUE_FLAG_FLUSH_NQ 25 /* flush not queueuable */ #define QUEUE_FLAG_DAX 26 /* device supports DAX */ #define QUEUE_FLAG_STATS 27 /* track rq completion times */ -#define QUEUE_FLAG_RESTART 28 /* queue needs restart at completion */ #define QUEUE_FLAG_POLL_STATS 29 /* collecting stats for hybrid polling */ #define QUEUE_FLAG_REGISTERED 30 /* queue has been registered to a disk */