From patchwork Fri Apr 7 18:16:50 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: 9670169 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 4AE9E60364 for ; Fri, 7 Apr 2017 18:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42CC22862A for ; Fri, 7 Apr 2017 18:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3712428637; Fri, 7 Apr 2017 18:17:28 +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 8D5F62862A for ; Fri, 7 Apr 2017 18:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934394AbdDGSR0 (ORCPT ); Fri, 7 Apr 2017 14:17:26 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:59686 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934161AbdDGSRM (ORCPT ); Fri, 7 Apr 2017 14:17:12 -0400 X-IronPort-AV: E=Sophos;i="5.37,167,1488816000"; d="scan'208";a="9379740" Received: from mail-cys01nam02lp0050.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.50]) by ob1.hgst.iphmx.com with ESMTP; 08 Apr 2017 02:17:06 +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=d6NCsLTD0X8KO5WlnDCVhI2ZrGoGOM/AsB9zTQObLBo=; b=k2h+lS2w3g2FavQTDTvXRHUM/Xmq5spwfuO0d1xPyYYVQWMvo37o+S3zDFcm3ILgbK5V4W98q+9LorqNGtQSHEX/LpOZwsSDNHW3knZ4L3TFSraaAXAbNc6LFuTng7pK8wOqI+Zh8TmuTkD7LM/nz1YZZm8arK2tLVPjvnwiXOc= Received: from DM5PR04CA0037.namprd04.prod.outlook.com (10.171.152.151) by BL2PR04MB099.namprd04.prod.outlook.com (10.255.231.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Fri, 7 Apr 2017 18:17:03 +0000 Received: from SN1NAM04FT051.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::205) by DM5PR04CA0037.outlook.office365.com (2603:10b6:3:12b::23) 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; Fri, 7 Apr 2017 18:17:02 +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 SN1NAM04FT051.mail.protection.outlook.com (10.152.88.201) 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; Fri, 7 Apr 2017 18:17:01 +0000 Received: from MILHUBIP04.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 69.7D.19026.C97D7E85; Fri, 7 Apr 2017 11:17:00 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Fri, 7 Apr 2017 11:16:57 -0700 X-AuditID: 0ac94371-41ba798000004a52-ac-58e7d79c97a5 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id A6.62.11415.997D7E85; Fri, 7 Apr 2017 11:16:57 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , , "Bart Van Assche" , Christoph Hellwig , "Hannes Reinecke" Subject: [PATCH v4 2/6] blk-mq: Restart a single queue if tag sets are shared Date: Fri, 7 Apr 2017 11:16:50 -0700 Message-ID: <20170407181654.27836-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170407181654.27836-1-bart.vanassche@sandisk.com> References: <20170407181654.27836-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsXCddJ5ke6c688jDJa0aVisvtvPZrHgzV42 i5WrjzJZ7L2lbdF9fQebA6vH5bOlHrtvNrB5rN9ylcXj8ya5AJYoLpuU1JzMstQifbsEroyH C6exFRwyqHi/Zg5TA+Nv9S5GTg4JAROJ47c62LoYuTiEBJYySVy+tpUJwtnKKPHtw29WmKo3 Da9ZIBIbGSWebPrOApJgEzCS+PZ+JpgtIqAg0fN7JdgoZoFNjBJ3r/0GGsXBISzgK/HgoilI DYuAisTafWsYQWxeAXuJT8uus0AskJdYtGkGC0g5p4CDRHOLIkhYCKhk/6ajYHslBLpYJRZc mwPVKyhxcuYTsF5mAQmJgy9eMEM0qEucXDKfaQKj0CwkZbOQlC1gZFrFKJabmVOcm55aYGii V5yYl5JZnK2XnJ+7iRES4IU7GF/f9j7EKMDBqMTDG9D7PEKINbGsuDL3EKMEB7OSCO/zK0Ah 3pTEyqrUovz4otKc1OJDjNIcLErivFmyUyOEBNITS1KzU1MLUotgskwcnFINjMVOmvUGOluD /viLP19yS/VCsYZFlfKLd3yr5izSSxeOYylx1nVWCvcVCZG5rsy0LHu71D4DieNnLywx0E28 +bq5xixwZ2tLYPJ92X32qRxbni+xLJDnz188KefjUaFH8xM6ji1UWmXlpBB2fuGGkBtfF64y LReyUJH1erP+3PLfrU+c/gi5KbEUZyQaajEXFScCAGS9bkxsAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOJMWRmVeSWpSXmKPExsXCtZGTTXfm9ecRBjMW81qsvtvPZnHwZxuj xYI3e9ksVq4+ymSx95a2Rff1HWwObB6Xz5Z67L7ZwOYxbc15Jo/1W66yeHzeJBfAGsVlk5Ka k1mWWqRvl8CV8XDhNLaCQwYV79fMYWpg/K3excjJISFgIvGm4TULiC0ksJ5R4sHDBBCbTcBI 4tv7mWBxEQEFiZ7fK9m6GLk4mAU2MUp8mdXG2MXIwSEs4Cvx4KIpSA2LgKrE03XNzCA2r4C9 xKr3S5kg5stLLNo0gwWknFPAQaK5RRFilb3E/k1HWSYwci9gZFjFKJabmVOcm55ZYGioV5yY l5JZnK2XnJ+7iRESFJE7GJ9OND/EyMTBKdXA2DxrwuqYyWyf7wZ4MJm98k84/n3WgsOTnmeW 9/6cq7na4FDt7s5+c/60ME5Je+X8WwdXZM+braP94J7pxPdGqlOS+mL+T1l/41a7WFVWDlN2 7Yo+0zWx7Nza8dmZtyZ33rfZlu0048ipygsh79coR0nFtrzY3tXq9cpxU6/bpA+XrzJfPdS1 WYmlOCPRUIu5qDgRAD15/Nq6AQAA 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)(39860400002)(39450400003)(39850400002)(39840400002)(39410400002)(39400400002)(2980300002)(438002)(199003)(189002)(9170700003)(2950100002)(6916009)(50466002)(47776003)(189998001)(1076002)(36756003)(53936002)(6666003)(50226002)(50986999)(76176999)(8676002)(4326008)(33646002)(8936002)(5003940100001)(81166006)(54906002)(356003)(106466001)(77096006)(2906002)(110136004)(38730400002)(86362001)(5660300001)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB099; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT051; 1:9fq05KlFY65ko5Se5nLymVNOXkLjFvh7YjXNN/fWMuW0My2s99fNkWPNu2OWCiLWXzJUVbl0QvntQ+h0PjWZ7GjitwBqej5ga/xpetajhnOq4gbhiS4h7mZ2ttOrhgHZ0Faacx9O/1nyUK2WixIIpaRiix2MSEk3O0/tJsdE7/HlpC165dU7tAKy/onhTcdPqH4DHtqVAs4XsMxs2nvdG96ViGP2prO8UyIQt2v+oZlb6+0UbVbbqY3xF5Re4Gv+csOBGvT2puSeosqsDlt61/VHeDrq2Ad1uYaxpsjl1cMAQM2riRauC5HYkvDu8HtEDVlk702aJiQQ7++l9/sd7M1F2ri6gJKQn/WcOV43NB0QjDSYbtkb7DgDg2FXm6mA2zSbY6K0X/AskNmPfzDYlsmHwxn/8EAZ813PrVp3oTGPf7bqoLYId3NICUPzhlIpj+xsoiMYFX4WJLPfqpc60mUG4vKlMCPPiuUFcv3fNQVAo5JlSo1q+o/ApAzHPeLz X-MS-Office365-Filtering-Correlation-Id: 92fc1901-14ec-4a30-288f-08d47de24a3f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BL2PR04MB099; X-Microsoft-Exchange-Diagnostics: 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HxkoZUEeg/HrQ2ZYUEy98/qgZmYtMgnCtqWr/f2Bzmhw+3TKQYzEOklexBfD7JWgXS03XK8FwCjYUYoLkTw2mKYrgaDSFL1u5/lj1kMN3c4T1vPiqJcb7CNLoaICT/yDC0RBMkUR6l52qFA+VRILcNt+NSwXVWrIX3QJYsXaOCFHxKhnMbwsz4CVnI58efmqMMYT0IRla6aFDPDwq4kobBZCt/ECjEcv4LcmtEIZZ754gDeEikoESS WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 20:7C2KerkFO4DdlgppDulUKWZiI/FFGNRbQoyS5lJESlTAbcNN9ZMBA+XL+Zu2zpvZRMYGUHcBSiVl29EsGWf+SSD9qnplkBXBW5X7dipo3N0q2HL7kpGEe/O9MztczVIi6PTKBtzXpcen6pzAo7tiAzjUvln9Cb86z3Oo0ukxsuqFo4dgX/buJe6vcVL6Kh4R/1+76Qb7+P42IxefNq/exUW2aZeosWEWpirQY13RDF5ky/jYwSa3RWBLdAz/6LxSfhZDSqdNsMo4a2xbZJsNvQgc3ao7MdjoIgu2/YnRY14VneYQuif3jjVAWEj8pATxaA3+X/QzBfw+W1HXi1pMOxUBpimkgxNSC7oHHjs2TOBcYkELfNbSAnBLevHYl/xXDzU4a6LoETA0TFmf2y4hlXrsjqlY5bMuESGXaPUFF+Z8+fIIiBxPnZ6MrCkpXk1McjfvXvFFENSx3CizoCLt+CiZxlh5pzVh+IBUQkWLdjT4TB00RRqEeO5L8lrmk7Wj 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)(13016025)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123560025)(6072148); SRVR:BL2PR04MB099; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB099; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 4:MMqiqCI+DHlZynmiJvJ4oWGZl670wU6byWDH5rzcBleXBeLDQLwHAPwQtVL13qSBcM5F6oIpf5ySw+3jHj7NAt5aAJtKNea20oj7/FR2/0XmVo0aDKfZ7qPiqIJfjfCII3nxQ6hUaSss6Kpi4qB0Pn4jCn8KTyVWd2sM7H4NLX7qSQ5fb4YwUIxy7KBc1h3V98oaQBffVCGZp9FxHLg+JNtQQ8xBa1AVBqYfWSvSp7WQ/a6evv1m9wKJL7t/Q6QfzXBn6pZFns39o1H7EwX6846hIjhfJzKl6J6NcEG8lRLpcT+MLlGXQF/glQYO5nEPnLn2ZBIOngMNYVtNOS0oj/M7XBb6REUCYEGEw5roRlT6e1hjZdE9TnwL36xZghWa97oZBhkk+h+xfBqT1Z6G13sfKCnUDJPMd/HR49y0ucayxe7KwIiJqmVKt+s17t/LJB1dxfTum5DGZSw+b3hkG2CbC9fQGUgMq1Jf6X4KC379/WwVUkA0iuP0xTQBmRQ5A7S0z0hSSRW5bxopj/37BU/+xhAEyJK5AwIovAUhRkcx6LYHCM9pE5YEpGv7C8NR4SDrgdeOeVyR7cZjJOiENe3w0s84DU3tGFQVfW6ivgJvy1cFzKg+EG6Mg8WLr3q/F+4GgsRtFw+NQvJ6yBvV/2aw25p3WVNQmXoRj7SdvpBjQSflzPUoMiOPODptNbOKpjsTL2wSmdoqr6A2zFsASwkUwAD22XhSU07i2K2cHQSO5/zkPoGByinUGSf2cNY42kg4zWDEdHEkvBO8COiYGv3bIIzUAay8YewJcn5b2RlF9stPrGwE2WMnSRIdzV0w X-Forefront-PRVS: 0270ED2845 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR04MB099; 23:SYvohFnne9VNA79wiEvYn8M25C6mbZna8Lmfio5fVy?= =?us-ascii?Q?OG9733XER0AOTY+IDw+D98DQR1Vxu5x+1buHpBt4XXCHrNnZRQYCICzOwnB5?= =?us-ascii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heH+UInzWuWxiALCFzXoPgLW2?= =?us-ascii?Q?E0a5YVLb+iPrrhIK98d/Bj?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 6:XqoE/JwdtsWfqDSn2dMHQEMFlxL68DXYdecoyEsW7+1H63d4ihQWUmz4nmybMV0AMDWbF7d4LNblBiBF3QqsHpqVq6xMbGeeWt7go17du9yWw2kVlL106O8PCkutTPNWuKHv5HRSHVE8obnrvMeXOCJOWMftjC6AhqyWSYjB71WrxMjJAQhY+TXtpn6usZ1OhuxAzELK07Sr4NE59m9QJ0onkPfa1ID6k6J82HMZFfBi1jA6l0YA0E+zyRHGoK/CgfIy/61TMDA7LgkdMCJ3CLRKMpj5i56u7DhqjtqwWKRz7t6hYUCkfolUyibzONBXDBZ+BFyW6FMhf7Fze64rahG7SVLHq7t0MYUvYVczhswErFC2+YcIe0QS4W+ue8HJ3CbBu9Rn2QchA0E67kN14wRRIq87P7RGOpKtmP7dHb8=; 5:XhjmbfNzs+Kvlpy6RaaIY3yq84vOonrbtwQbr9R/dMsm03uJ6pbgtrTOMgGFEKVexmCsMqWYYdei+RIgjx0vutsavwR0yprHzy8aV4Qxa9Kdvv/uDy5Fmh4/euHo+fv+Z+MQld8pGxW5iAoBvke78A==; 24:XOrZD7ALVI/tEiD7UdsXjqJJCklmZskskTbUjUQiVxd3ptH6Ob72xWHm2eGxe6A1vFUEJlCAbXhwAX4fsY9lf/oH7smE/XNkhtmlgm8MMQE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 7:9iEweLQb7ieXtCW6CThiNr8I/I87aPcQ+eBbEr8rBkN8rIYVcJtj6f/bTYgZe3ZPoBw17CjOqQWrzcm+eadxfiuakGXFEOvJdNcwoTvVt5k4hWnUwFJKgLXJjnY+94IOwYWa74063ZIdhKOIMDWvh1kpoAFK8/dlwtHdbsDLghcaF3ey+m8SmNS9pgOUnGw8Xf9IsVYKU5+xPViQwlADciN2pezVBPcl0TikSLcoL34MPeV9k6G8QaOP2f5rjv6hBiGm/RrFwPNSaNbYt3FD1FVGAkB5N0Ub+OX6502BdSFQb4kDegAo2FoRWxiPvmXN4xQFQkHKK7N2UmRXQA7XjA==; 20:Csklk5To+hIBII2sitxxWGP+zyC7PI4J9jNp/sxjPUqps33RUUiSTM5GyjiiGsRHYcVpejw+FRYRbCNPRJ7+IKN3dVbMcxnokJeUugSeFaSYR2ET5Y12jik8h+3AO31J2JplKAujoKVj+zRol5UMyUn+vs4R8pswwUv3nuvtc4Y= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2017 18:17:01.9378 (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: BL2PR04MB099 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 Reviewed-by: Christoph Hellwig --- block/blk-mq-sched.c | 63 ++++++++++++++++++++++++++++++++++++++++++-------- block/blk-mq-sched.h | 16 +------------ block/blk-mq.c | 2 +- include/linux/blkdev.h | 1 - 4 files changed, 55 insertions(+), 27 deletions(-) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 09af8ff18719..a5c683a6429c 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -317,25 +317,68 @@ 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) -{ - struct request_queue *q = hctx->queue; - unsigned int i; +/** + * 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); ) - 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); +/* + * 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 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 *hctx2; + 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, hctx2, i) + if (hctx2->tags == tags && + blk_mq_sched_restart_hctx(hctx2)) + goto done; + } + j = hctx->queue_num + 1; + for (i = 0; i < queue->nr_hw_queues; i++, j++) { + if (j == queue->nr_hw_queues) + j = 0; + hctx2 = queue->queue_hw_ctx[j]; + if (hctx2->tags == tags && + blk_mq_sched_restart_hctx(hctx2)) + 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 c26464f9649a..dba34eb79a08 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 */