From patchwork Thu Jun 8 17:33:44 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: 9776165 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 5E589601C3 for ; Thu, 8 Jun 2017 17:34:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 464E226E4D for ; Thu, 8 Jun 2017 17:34:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA9B27F17; Thu, 8 Jun 2017 17:34:41 +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 106A926E4D for ; Thu, 8 Jun 2017 17:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751548AbdFHReg (ORCPT ); Thu, 8 Jun 2017 13:34:36 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:63109 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbdFHRec (ORCPT ); Thu, 8 Jun 2017 13:34:32 -0400 X-IronPort-AV: E=Sophos;i="5.39,315,1493654400"; d="scan'208";a="23819233" Received: from mail-bn3nam01lp0181.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.181]) by ob1.hgst.iphmx.com with ESMTP; 09 Jun 2017 01:34:15 +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=hfeWtTbzymeznbry8gyP93vrBTfr7gmgVtin7rOAZpI=; b=HuP76RymLn1C9wyFnmjkLmxksHO0QmFa8QnBkoVZei8qjv8s0r2q9ntIlV4sLdaz0k3Vv8tMzvt7PvGpKrcRl424ZFM9s10s+abyjnQ9b6FzzEWMTvcnSYCxoqhHpwY1yhptQqenSIs7ZIwTGuzyZuQTix3aOfYCfS7WI0ohNgk= Received: from MWHPR04CA0029.namprd04.prod.outlook.com (2603:10b6:300:ee::15) by DM2PR0401MB1469.namprd04.prod.outlook.com (2a01:111:e400:5026::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Thu, 8 Jun 2017 17:34:03 +0000 Received: from BN3NAM04FT053.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::207) by MWHPR04CA0029.outlook.office365.com (2603:10b6:300:ee::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12 via Frontend Transport; Thu, 8 Jun 2017 17:34:03 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN3NAM04FT053.mail.protection.outlook.com (10.152.93.2) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1143.11 via Frontend Transport; Thu, 8 Jun 2017 17:34:02 +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 0E.59.51736.88A89395; Thu, 8 Jun 2017 10:34:01 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Thu, 8 Jun 2017 10:33:58 -0700 X-AuditID: 0ac94369-6dc8f9800000ca18-07-59398a884b27 Received: from exp-402881.sandisk.com.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 09.E7.18148.68A89395; Thu, 8 Jun 2017 10:33:58 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Hannes Reinecke , "Omar Sandoval" , Ming Lei Subject: [PATCH v3 01/12] blk-mq: Reduce blk_mq_hw_ctx size Date: Thu, 8 Jun 2017 10:33:44 -0700 Message-ID: <20170608173355.25898-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170608173355.25898-1-bart.vanassche@sandisk.com> References: <20170608173355.25898-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsXCddJ5kW5nl2WkwdYHrBar7/azWSx4s5fN YuXqo0wWe29pWxya3MxkcfjeVRYHNo+Jze/YPS6fLfXYfbOBzeP9vqtsHuu3XGXx+LxJLoAt issmJTUnsyy1SN8ugStjardpQZt8xf8JVxgbGF9LdjFyckgImEi8fvKVsYuRi0NIYCmTxIc1 t6GcrYwS73vnscJUvfwwgwUisZxR4vD0sywgCTYBI4lv72eC2SICChI9v1eygRQxC1xhlFh7 +TsbSEJYwFpi+tGrYEUsAioSp7/1MHUxcnDwCthLnNrgDrFAXuLslp3MIDangIPEtZ1LwFqF gEr2NkCMkRCYxypx+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OPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39410400002)(39400400002)(39840400002)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(8676002)(36756003)(48376002)(33646002)(38730400002)(305945005)(47776003)(81166006)(110136004)(356003)(2906002)(86362001)(1076002)(50986999)(76176999)(478600001)(77096006)(72206003)(4326008)(5003940100001)(5660300001)(6666003)(8936002)(50226002)(53936002)(6916009)(189998001)(2950100002)(54906002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0401MB1469; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT053; 1:z9lVX0+b6bts730ZGCEvuy4S5yvL1alQtwaHLRkPO71tZfI+IQcpxd/hOjnUejeURSb476wlHbofYhRhRv0d8BOy2N8xuW6K35NtRckiM5IbYpGu53MDN0I3XMtCxgLpEhgIE9wY9VFYXme6WST0Fnp4zoUHWqKJvGXoAgj+saGSmBb19n0u385EuWpBHHQbo9XEVCaJpibKtLEcYxUsAX8V9ocJTccyYXihFh1wlscKge7Gi4MsW5/q/VOFy9vNGKhBXbUokQmGVMyS4Esh7lCtfZax61BdH7HKqSv6FgNGz6rS+O2rYiLYNp5IdzzxUDmRtMFZETOcwUgmuxGfdRIDjAYIZ6MAM7E7CRp18v0cyFMYO23Q8qf6iLoH3iRlRwAXuLY8rRFkwAAbnMlHvOSiRnZM0UwnHqABEZAUxbJ7YdNVhUFKXw7Znr4NC5sVyWz6Mmitp9XY9AmGC1wAbqnXJ8hUVdaiNBBgE+T9B9r9gFgKk1Je+yQ+NjYNqt2HbBGWN0C2O9+7G0YqfKJa3/jQo1JpwIcmZbHo4fWas6k/rUt7CZmz+tHz1Ze77NfZ X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0401MB1469: X-MS-Office365-Filtering-Correlation-Id: 70d953b6-2b9e-4ffd-7c7b-08d4ae948e19 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0401MB1469; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1469; 3:YraBLZpm3R5cuQ/NGcpg5nLogVkBlqw3p9U7MgBTCnckT1v1s765cvMCPu2SPuVimKp3exUSmrxH4Xj+jc1Y5B1WWw2mJWyoY1rlqdibuYMYDhG6WuV3TVXvezDaWpVHw3Zhx0XpheE0MXiSVmu7qbks7nvMaWosT0g5qFd4wD9/4Tzb91OJK6Hvy0q7elpAH/GQs6XHo4DANGF9BpwuFEGm1EZQdTZevxHkAJLv/1bz+2XUlkeeYmDJ+JNLM+YMRat/hwxvXz/x08GJUxZOXEierDhwWK9LNBcP7qg1RCWCmbZ3VhUqN+lDnyircUgotYyjK26OdAjKj7tPxKeA2CIdgzpTy1lUoOqDto1djhAY+//RoYEnrv7uhv0PFYoDYryGWIu7mTbRQH/JtOiuV2EJCgitWH+YTluapTYoi7iPXovuFK7psSnTnEv3jnWS0oUEBtf7XhlZS1z65pNtPlWg+KvyiYOgyGmYAe8sBfThOo+svo/G53Yct6lbtrBF X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1469; 25:EM4sUUPD7jpmw5BixL5cif6YtZPP8Avb2C2bO5WCPORWR5+kgI6TtCYIPALM1KnAPvMARVAiO4ZeDj5H3nZEqbQXUlZrDh1+Ere0HTwojRBqhBz3GgZmkkEzh0S9ot3dEMaP2qXdGP9o9my026+YBzmbpCWfVY2BgOZg2aEkioyFHJ9s+k86rPQGoCLI6QcfMZN8ad/Vq7vydQND/sacNT5pwW2BrvsSCBlJ3WWMIOSunzkewaSChsJWxHuKkmjzkox+1QhwEK+MuVK1gBzRRFqpmr+LJ4QUowtl1DeF0YbUvwtsBIqA3eXOyPV+B7y5Gf5NbmJF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672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0401MB1469; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0401MB1469; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB1469; 4:garQEdyVJDYI4efMDH5zzsHs840G+Qz/+KXgFsvf?= =?us-ascii?Q?wVoPIeQ0lUwb0XlQFT6InjOxcckxq/KfzPYncmN6yOkZ6YAhu9NZ6RplBCAF?= =?us-ascii?Q?xgZAEKYHSHxnNzcb9fhu4VbCeDlhZ/hM/YYxNsU6u1o+1s/7AeYWSEmw2kGM?= =?us-ascii?Q?hGBtqG6bETcGiPa5PZyX8auansc2tOUdqpApGTqypCwoHn7UZpxV8M6oNevk?= =?us-ascii?Q?AsVg8XMsww4lQNyghTEO42wwh1+egGPUNPiJCz01dim7FMFOKyldJQ8iZilT?= =?us-ascii?Q?QBzUaV2rl6LaSzZK75BPyzusoMNkTEhFlBiBAlDuI547lHnadK7PiDXl922L?= =?us-ascii?Q?DNXp19Q54N/tud9oLylLBwZazprCAS8fxypnfKREcS+42+k0n5qMCeaNvZam?= =?us-ascii?Q?8LVydySKFab/ioGX2DShOdZH1avOi7jdzS7J4r9NqIh136kfYIQVMuIKeVIF?= =?us-ascii?Q?1IuZ43+zVcJ40isB7V7mypbcikWTGwTr63HJ2qzEh2Ge/Czv5IweOuCGahXE?= =?us-ascii?Q?+qqe+fkojUVm83K3Za2SCREhBsgGD/OCVUwrJwXT68EzXElUVZUTdpkLXMfY?= =?us-ascii?Q?UGJCWSezN2VPfaOkT6GFSroh9kXoyXBFrtZ4xVWvjwspEncGP1CPVHUcKTwB?= =?us-ascii?Q?GM4QKzc0PUXVPDk1Hdp9/8Y49vhJfEh7BV0Z8j/yoeSDIl5vpuVv64QM+brS?= =?us-ascii?Q?+q1sLfIpjKdGrn+IKvMww63aAPSmCFbvHs/X5DZw8QYzPY/2GskIfJbo2zTT?= =?us-ascii?Q?yZrDs3kZNEj3UaQ+pzambgvbhU1XjCbgWfGhDPOD99YC086Os7RBIfhfbz5C?= =?us-ascii?Q?pWpQDwJq1p4jLPJCcgzDv/jYoGO+y1qFQrYsGVfH6bkjl6KBvGr5TJQNwhe/?= =?us-ascii?Q?NPxg55rRhH9SYEDfQU82RCFCKhzJs4fhJZwJolfNCeXv6PXja/svxQBeNlCD?= =?us-ascii?Q?0kwnFMDGcJA9DPHxWChnx5JfdyhSCXFFdRG3HIxFYUIiT7W+2ejr0IJB+hPO?= =?us-ascii?Q?GNVwa+Sey/L9M3yUVLda8PHMubJFWpItQpt2MMyG11oYHX/TQcN4Ju3fr9fj?= =?us-ascii?Q?zDGKC9P/UaayGaMmuxAMoNWp6Ibs/I+okl4S5AhTP25H8t8kQqkeq41IojGh?= =?us-ascii?Q?uJJUUpNKxG4Re7jK5AGwf0NhpPU97PN5xhXNjDfVkbVsSMg0tzw3o1VM3p5W?= =?us-ascii?Q?cpFz4tnRMbjD+lQK4S3gc74keZwwDNME/eRsC7AXC99JIrZ4+juUbkti1agj?= =?us-ascii?Q?dVRxNshG5DEAmiDjZbSlcfllUWtSqksuRuLBo9u3yQ5WsMSmfIrZer3KZFSF?= =?us-ascii?Q?wg=3D=3D?= X-Forefront-PRVS: 0332AACBC3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB1469; 23:tKZCFI4Xe+hP5POGS+sjs3h02k5+BruOFdcV/h7?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gpyi6fbs4ImjY+AJbgtm3JsYMBhhg+46/RfoHHQmRghxiU5Y51hU5me/8wdY86hkpfGrw2hrY6VswRHvW4uX58P3N3TZnR1tMRYlncDlbFDmmzFcL4D+7kWLHBtiQrPU/qR05/X/42hMAZJ2oOEOgqeVUkXDIrdCDCxBHUuhfRo7vXdrqKV3+WpsEgJOLO9xn09fYn2p3zwHgplrduxfYAgH; 24:ne6rbFvIhXCqRbtPdSZwloW0KHleB/kEAe3I94RRP191fiTkLa50avgtqZi2d9WsL7FuykRIenrn6rWhtl5+HlQxoD2jRns52/DNIAIfZbw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1469; 7:QTMQHbAudDi7keGdsorFmx6+uZczUjqZXi67tZv4qtq8wVxURcdYlRCsiwvMvJLFam2i33mHgEaTQoKhrZtVMMowuu1jYvFgX9ql2idxSaQ2G3JfFgSlqoVfF4fdn/aWks3gHlSJWWWPUm0CU+k0RsQPZ5ha4XrQcBE3bgE1T2kN6/apBcsN/YJMzTfne6ipcvKd7nUFTCTtiVR84u4KgldESHu/9hbGUYeTac0fbXc7DHmSmyDdHHnRyJVGUE7xQ8ulY2fS/GM4VvCFd/xukhc2+0FVDjts9Lv0U+CjueQKuc9JCgFDH4+AUpoOafkzOsOVcqiOoWZWslpaRt5HNA==; 20:fvg5Qbtwax1oQer55Ua8Basg268Ne6ujQLhXl79qF3mh/e1M+hqV4gpg00Pw4GZSj/efHxF+lAI2CP9MvNRdabEMQTckoMRZwYhlpDui7qFfNRxJyep1mfW8XmD5YOYqSPy2R0Ex/IOauQt8nT6ESjhMa0rzmjrG9v49oqP+Fzg= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 17:34:02.2720 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0401MB1469 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 Since the srcu structure is rather large (184 bytes on an x86-64 system with kernel debugging disabled), only allocate it if needed. Reported-by: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming Lei Reviewed-by: Ming Lei --- block/blk-mq.c | 30 ++++++++++++++++++++++-------- include/linux/blk-mq.h | 5 +++-- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 4e8b1bc87274..ef64a3ea4e83 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -172,7 +172,7 @@ void blk_mq_quiesce_queue(struct request_queue *q) queue_for_each_hw_ctx(q, hctx, i) { if (hctx->flags & BLK_MQ_F_BLOCKING) - synchronize_srcu(&hctx->queue_rq_srcu); + synchronize_srcu(hctx->queue_rq_srcu); else rcu = true; } @@ -1056,9 +1056,9 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) } else { might_sleep(); - srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu); + srcu_idx = srcu_read_lock(hctx->queue_rq_srcu); blk_mq_sched_dispatch_requests(hctx); - srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx); + srcu_read_unlock(hctx->queue_rq_srcu, srcu_idx); } } @@ -1460,9 +1460,9 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, might_sleep(); - srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu); + srcu_idx = srcu_read_lock(hctx->queue_rq_srcu); __blk_mq_try_issue_directly(hctx, rq, cookie, true); - srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx); + srcu_read_unlock(hctx->queue_rq_srcu, srcu_idx); } } @@ -1806,7 +1806,7 @@ static void blk_mq_exit_hctx(struct request_queue *q, set->ops->exit_hctx(hctx, hctx_idx); if (hctx->flags & BLK_MQ_F_BLOCKING) - cleanup_srcu_struct(&hctx->queue_rq_srcu); + cleanup_srcu_struct(hctx->queue_rq_srcu); blk_mq_remove_cpuhp(hctx); blk_free_flush_queue(hctx->fq); @@ -1879,7 +1879,7 @@ static int blk_mq_init_hctx(struct request_queue *q, goto free_fq; if (hctx->flags & BLK_MQ_F_BLOCKING) - init_srcu_struct(&hctx->queue_rq_srcu); + init_srcu_struct(hctx->queue_rq_srcu); blk_mq_debugfs_register_hctx(q, hctx); @@ -2154,6 +2154,20 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) } EXPORT_SYMBOL(blk_mq_init_queue); +static int blk_mq_hw_ctx_size(struct blk_mq_tag_set *tag_set) +{ + int hw_ctx_size = sizeof(struct blk_mq_hw_ctx); + + BUILD_BUG_ON(ALIGN(offsetof(struct blk_mq_hw_ctx, queue_rq_srcu), + __alignof__(struct blk_mq_hw_ctx)) != + sizeof(struct blk_mq_hw_ctx)); + + if (tag_set->flags & BLK_MQ_F_BLOCKING) + hw_ctx_size += sizeof(struct srcu_struct); + + return hw_ctx_size; +} + static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, struct request_queue *q) { @@ -2168,7 +2182,7 @@ static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, continue; node = blk_mq_hw_queue_to_node(q->mq_map, i); - hctxs[i] = kzalloc_node(sizeof(struct blk_mq_hw_ctx), + hctxs[i] = kzalloc_node(blk_mq_hw_ctx_size(set), GFP_KERNEL, node); if (!hctxs[i]) break; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index fcd641032f8d..c534ec64e214 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -39,8 +39,6 @@ struct blk_mq_hw_ctx { struct blk_mq_tags *tags; struct blk_mq_tags *sched_tags; - struct srcu_struct queue_rq_srcu; - unsigned long queued; unsigned long run; #define BLK_MQ_MAX_DISPATCH_ORDER 7 @@ -62,6 +60,9 @@ struct blk_mq_hw_ctx { struct dentry *debugfs_dir; struct dentry *sched_debugfs_dir; #endif + + /* Must be the last member - see also blk_mq_hw_ctx_size(). */ + struct srcu_struct queue_rq_srcu[0]; }; struct blk_mq_tag_set {