From patchwork Thu May 25 18:43:19 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: 9748921 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 ABE4A60209 for ; Thu, 25 May 2017 18:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A26302679B for ; Thu, 25 May 2017 18:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 970BF2836D; Thu, 25 May 2017 18:43:53 +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 085B42679B for ; Thu, 25 May 2017 18:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759279AbdEYSnw (ORCPT ); Thu, 25 May 2017 14:43:52 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:19335 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1036482AbdEYSnj (ORCPT ); Thu, 25 May 2017 14:43:39 -0400 X-IronPort-AV: E=Sophos;i="5.38,393,1491235200"; d="scan'208";a="123007587" Received: from mail-dm3nam03lp0016.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([207.46.163.16]) by ob1.hgst.iphmx.com with ESMTP; 26 May 2017 02:43:37 +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=OKTvMIpnJOTCTU2Mc4FIAlce70sNcw9aZmJxy8/2R2o=; b=unh15+MZPTEQ22ONy50hrh7/RSjIPZuTTyUjGysl0dtpeKuGy2lQtr15uFe37UptcvhrbH5OZn1dWXCfjkPn9qeiTLVpSEpoSUhahjw6bbQR4ndGpZPvQxx6fZU60Fq7CCtBEcrf0Bd9a16v8UWKDrgtu31HIUgrZHoKbl9WoZk= Received: from MWHPR04CA0056.namprd04.prod.outlook.com (10.173.46.18) by BN6PR04MB0357.namprd04.prod.outlook.com (10.173.198.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Thu, 25 May 2017 18:43:34 +0000 Received: from CO1NAM04FT057.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::209) by MWHPR04CA0056.outlook.office365.com (2603:10b6:300:6c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Thu, 25 May 2017 18:43:34 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.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 CO1NAM04FT057.mail.protection.outlook.com (10.152.91.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1101.12 via Frontend Transport; Thu, 25 May 2017 18:43:34 +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 DD.2D.19026.4D527295; Thu, 25 May 2017 11:43:33 -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; Thu, 25 May 2017 11:43:28 -0700 X-AuditID: 0ac94371-41ba798000004a52-9d-592725d49dbb Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id DC.E8.11415.FC527295; Thu, 25 May 2017 11:43:27 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Hannes Reinecke , "Omar Sandoval" , Ming Lei Subject: [PATCH 11/19] blk-mq: Reduce blk_mq_hw_ctx size Date: Thu, 25 May 2017 11:43:19 -0700 Message-ID: <20170525184327.23570-12-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170525184327.23570-1-bart.vanassche@sandisk.com> References: <20170525184327.23570-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsXCddJ5ke5VVfVIg19v2C1W3+1ns1jwZi+b xcrVR5ks9t7Stjg0uZnJ4vC9qywObB4Tm9+xe1w+W+qx+2YDm8f7fVfZPNZvucri8XmTXABb FJdNSmpOZllqkb5dAlfGooXLWQtuCFYc/rmdtYHxNF8XIyeHhICJxMJ5e5i6GLk4hASWMkk0 frsH5WxjlDhwdB4rTNWD/ceYQWwhgc2MEl8WpoHYbAJGEt/ez2QBsUUEFCR6fq9kA2lmFrjC KLH28nc2kISwgIXElNb9YM0sAqoS7xcfA2vgFXCQOLKxjx1igbzE2S07wWo4geJfpl4E6uUA WmYvceKGI8hMCYFFrBJPX0xhg+gVlDg58wnYHGYBCYmDL15AHacucXL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ant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(2980300002)(438002)(189002)(199003)(9170700003)(305945005)(4326008)(106466001)(72206003)(47776003)(36756003)(6916009)(5003940100001)(356003)(6666003)(2950100002)(33646002)(8936002)(86362001)(50226002)(81166006)(8676002)(38730400002)(1076002)(5660300001)(189998001)(53936002)(76176999)(50986999)(77096006)(54906002)(478600001)(2906002)(50466002)(48376002)(110136004); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0357; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT057; 1:2cJsFpa/zO6QkFngf9Thtc1IK10EO4qRA0zpJd03b8d5y4RQjK9bsYEK5486HooG3Gz9fsk9BvuB/4Urt5Ff138C7iyyO3FeJXgxJSoYGybXV/q5K8JTqLmvos/CgmysHNQ2ecpezN7QbmcjVXYxMAEK+Wsndu5uU1kiplmeckXeDvsKntzqkH1HU1+ckurJtibXlALHkW7PEtSWZt9poZoOSRk1+bfwsWnqp9NdTCODARJmk9N34ofJtghNx9AE8bAGFN7IzVZ9Dtsf1cqEkdK/kkjpJs3iNUyx5da5ZVJELBspFY1TX8w1KV1vRS9o2csCnKxqNepdOg7Yfy1zwEzRhFYB3+t7+AnQiTzdhmx3L0Nh03beHY2i73GMihyQhUS3qPhy8CHBEPqi6TfSxiPPDhIlGuW4uAybHH+3n41wfll+CSAQ2Kbz1N/69fLLcWmdZtDAHXvZYxWXKMHVC8NY+nuBjKQrKaGYhKafr/c0FRRD6Ayvi8kOX1JphzzujYeSa20xogo3/fCByGZMJEhuckdU7U/t69v/WCYgrT0= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR04MB0357: X-MS-Office365-Filtering-Correlation-Id: aa7fef1e-d596-4808-0400-08d4a39df2e4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN6PR04MB0357; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0357; 3:F5duQ0oqavq//Ixj7Rm5birjArKPNQ3nmpymNcXe/iwpAo59ycjuLx804PXc8iXiaedK2BktfSehiQnUTz+G7qKbLaCg723nQytHxhLrbF1XvVQ3PWggoB58i7w23P4CnIZ4XcbClMwGD8dFDVWelLOU6xok1mRyJjAFbdRGkv5D51vStbWhg3iQpCq0yJXMtsgZfRRqJSHWS5nmFHFiZ2zwRkXmmstQwI6w7evtf/CtApJBGOpbjcne0MbDWN3j0Ns7xtyrIco/rNUbgYZeYgl6IsKjC0fL5JetcyjwFltjxtpyCP8JJVzs/QuzI4d8PbRt7YEYx38iGjMcMPA4m869rhs1LRd9hVcJp9WdNy0LlWRnDEr9zzy8lPSEjXZFuF2z7CWLRIuYwB/RlIaBp+B0ZdNHBHNNMJZFQRJcHtk/qQ/3rSW76zEJAYUG4w++Nx9VxkvbzXsfQwsD5O9t4NOnbr7Y5F7CEenQB+dlE3NF6iU3JKPAYhli9iYslCQu X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0357; 25:Iah+TVIO9FzlBSczU4tEkaggrh0L1cRq1tyUHNb8yS9oqo2uKQWjK6PgCT+aslJFPKApdq1tsDU4ePFXNqSLwEdr27OYFzlxTOacfCRtOKMSregHb8HJHpKK7XFPmre5ucVd8J7ch+Ac4VGjnxqaru1pmYALf8BYKhQKmIRen4zrJBROXXAz/2CtEywUYf3XI1iJ4x7DUDmQNDkTHRdHQfuL8F5bbdOXF2thFaew2b06iCEj2pRmBE1kQ8+mY16HwA9a7fFHnrLJQqwvae0rwfjV9XXTTk6k9Wwnnoj3PGl2fnIuXXUSjKL93EEFBhcxiL3P2prDKDrfB/j/QxPBY1cjpQEaxzKrRTwNYTJrlc9C+ozPWqSpBXXSehpGHt+OaoY44+MVOTthMgGJ6rCqlAv/ipWYqLz12IydAiiL4RGthc5eAynPhMTEDxR+UW8ZG8pCf5du8o+JODI4pakeDK1xXXK+QJVjUsWR4eysQMQ=; 31:NRGRCZ8R9mq10C4c2JLgSnwhKU9/h7v4swKwyQZBtHHD/7PkCp+B3I7YCJ5/htNn/lTHyEnuBSMWD/QtBYYtsjkIs7zfwCepYDtBRXKFkreUF9aPF0hOkyRolkK9ArK2ZWO+Ldlv2IWtLQvYn64kkDdsS4z4qOw23vxdPM6Nh31TZjFGCCByfDEjVSssAoMfrcG406UFoX1eWFnBIU20l0/KQy5B0+x4X66pWM4kVF8VFnF7mMnNT7rpXpiWzbvX670gGxm0hu3oJEWxjbQpWA== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0357; 20:DOOl6Os9OwxW6siYCaxLFrwnMF3QPKBI2xwkAm96r4UXCHzcOh+vYQUEZkHu4/07mIV/IVtgkVubxDQ2oEFjWS0XaxFHTTYN8DdXEqwxzrEaJVF1dg/DlCun2uG4AqoTpvgm1Cc0M8JirdOqY2xa2bMAHGiGd9W4zIRMitKOQ/Tfcl8+4H7zkOZKJK2WI9QNVGND83g/GP+x9CkXEtjx8vtfGFeN5cnqAoaI9/Or7/2zP9U66fJVgq3I5E0t6KcPfNLiKKN/muw0u5mKupYJ6NdslXHlWIGoG+vrwrzgZb/GX38lk0KTfgcbTmN2UG1/XzFvpuSDCosTZPZUzzFZNFMgdh+sHN0La+p9Yr0OTZk3gphqvgUw5wowOf1/2Q4h1RJ4zGOV86xDx3al/I/LZK/cIAWJHPnH+k11TEaX7ISrK7t1Be+KioWhcDgFugInw56zlB7CpI7IhLYOQY2ZXQ7dOeZMc7Q/jOIkKylrxJQZj8AK+FBQQr52GKTcgnNk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700054)(100105000095)(100000701054)(100105300095)(100000702054)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(10201501046)(93006095)(93004095)(100000703054)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123558100)(6072148)(100000704054)(100105200095)(100000705054)(100105500095); SRVR:BN6PR04MB0357; BCL:0; PCL:0; RULEID:(100000800054)(100110000095)(100000801054)(100110300095)(100000802054)(100110100095)(100000803054)(100110400095)(100000804054)(100110200095)(100000805047)(100110500095); SRVR:BN6PR04MB0357; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0357; 4:VxzzXQZbF5UE0JxUEGBaDHG6RsAU18xKtKbs+VeY2h?= =?us-ascii?Q?GidMMLzeUkFLg54Xu3AQ3Juol8d4OuuT8/WuMRzXSuCCa2sIAWNO3Rh0jX6p?= =?us-ascii?Q?hpX3+sVCjyUXoZ6xB84Pvk1f0xrNvnf5P4GJw7A0ZFkaEZRCQ4vEVte0mN5P?= =?us-ascii?Q?jxLIDHPRH5r+K/o+E6CVJOHuDF3K6iaQSeB8muIDnUuMPEUcAmxFR145mZbp?= =?us-ascii?Q?OaSGYHyPfKTbdmopmC0Pg2+xTBI1+zwrMJ+elAwjuDlOTQowz6yN18BlklsY?= =?us-ascii?Q?82dSjMVEGAvDHl8cRL37CTvidvgUmOYpapzYIG/zIzyhRaZ4dlPATNC+TFze?= =?us-ascii?Q?7Fv0DxvBa2YeFnZNmvIaVsl69IRV/7EeMa30zIKuI9OHtZHN9xrB/yHic7ZD?= =?us-ascii?Q?Dro6n8G3W0ER8BgxVuK6ulsUlOCkUz4GEwgTgdidgD5//eDF3BYjZ7xjojXf?= =?us-ascii?Q?/NbR/BpA/nd76uCkZyLzqU7yiLcHISPVzWPxcDtqO7a3l6gAuZKX3pAfLUS6?= =?us-ascii?Q?ez7p7iwg/VQQkYuL9tDIZbMapjecOGCAhl7dLusRdAnezEXTkE3GBBLEgLiu?= =?us-ascii?Q?yMB6HUXZT7bVstneHisOlIhdzwOVuEHhwyYUyoC67OK4TglPY/NQ5TpMBg6/?= =?us-ascii?Q?Dp3hK3OaCqWCfg+inzzrRtkxXhRa1JjR1eZopzxabNxUIjTniQlz27eq53mS?= =?us-ascii?Q?p7qUBq4ptgxTdS0X8Z5oetspQtwJQtS7NfngxDQg90LE4Eq30xH+/l5NZWHT?= =?us-ascii?Q?PYiCBRp0XAeo1RB2wipkroDekhFOnkgTPNULaxn4QTbCz3xjZxISjq1ARHRM?= =?us-ascii?Q?56UoP1TUZOyv/VdMsojkH9ZLp60BQbjJxDa22P2b/bE29fCMdaVI14DFbgsi?= =?us-ascii?Q?KNQZGYMnGL18bPiy0b4PfDXCSACcC07Mxc5aDjqo3y2613Qp8ObU5VgMS8wU?= =?us-ascii?Q?NyTcxRKmsqBmN6KOdDzQh5FM3dRrW84odDAkxi9h2WFnKn7KlHy0p6CYLxuQ?= =?us-ascii?Q?plZzsrKgqwhTseK8AvMdsEThTmAxsDxayBIgYiaxNTHCP8UmMSva95ljBY3N?= =?us-ascii?Q?oDE4xxQUBVhTcv68kkDzQq3uuLAI/wDQkD8t6uYTqVGkbeGarAbVeboQYDOv?= =?us-ascii?Q?DMY9lWMIcdwidXAgdPTY7KGyReUjS/hq6zAP6TgA+5wKNmcP4j5B1qLu9DwI?= =?us-ascii?Q?swbbmWPd+uxyY9mX0sijJI4ey/et0B/o5aI2lEiBoZs84EzfG9B1cqbd+pN7?= =?us-ascii?Q?PEeKrZKcDunXPlsPbqLEMZcRAsyLACLe50r25g6oVwzf1UbbpPR7UDW6yQCQ?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0318501FAE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0357; 23:LeRtUOuvsKXF94nsVm3gu+O56ZEd1NJa1PgIdRLzU?= =?us-ascii?Q?6x4S/hh60g8QRLW9QBb2ls4OAuJZTA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n5qo8JpwZsR6kaGUxPglvjx60Xx9Bf60mBQ1QjIrfVDoWVLXUHJ5C8mIxvZdOA0q8M6gzOSBF1mc8AZ4VvjxdthH1WuyzugevwDoxj39IG/N6Q+OsONhSYsWbV8ISi/V2JB4pvpcq4dYa66goRIA3Hb3UwKAExxmOsEMXuipb2JUm8hSrzaV4el6KHmxQedHBuhCsfjbTWnLx9eSKF0Fahm2N+wi87klm/XG/DYG0TsnsBd1HjV3fjegBIlIO1M5b+aG; 24:ymoTLraFvAFyTMyLOMmGF6ZL/XTaBFJEuomRfCr2oY+52TJDyktP8UXNvML5eYrnl5Bq1I6R27WSIK8LH/65GOLvXhpRQg+UAckw5I4Ar/E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0357; 7:RNpPEbD0Y1w1PYOO+jPJ80amXsmW+Tg+hUJnUc3HOZjxByJWwPBkUY2ztuZMGH/ZshgL32EeQYnqBT61PL98sZmxkz1CoIlJa0+LrYlLcasFnYxYrxjr5sDU2P8uFyezkK0w2x04Yku9Lhh62Vv305opnaSoyk/9bGBUEdSZeU5fs0iCj8JUaNae+TcY0qIH6kpzRuSRmuBPDRnxbLjXC49IRotiVWMqljm50G9yZD9PzLa75d+WWthJ7fx9ZqBxvddQnLM865RKNtz8LA1dupumIQlnU+9AePuWk7Wmi823GBCMjXwQB4t2WqW+UcNG/JUieJcbcoxrta1RYVzKUg==; 20:24QJtUZ3s6aAWuqjFYpRDIVh8iW40naRaQpokFgFvdZr4KUNpxvb7/bL9Txbs5CaaKQg2qytP7Z3mJbzyAqnrbMVDFSMEqZYxMloRgReMK4x1ggOBjFNYmaPJPnUeSOEEW3BqZl2U9v9XIZCkUlw+yGGKEaoqclXEUTLzEMfUkY= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:43:34.2242 (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: BN6PR04MB0357 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), only allocate it if needed. Reported-by: Ming Lei Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming Lei Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 16 +++++++++++++++- include/linux/blk-mq.h | 5 +++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index bc96e6007e53..b8092786d42f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2227,6 +2227,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 request_queue *q) +{ + 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) { @@ -2241,7 +2255,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(q), GFP_KERNEL, node); if (!hctxs[i]) break; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index c63d1d98404a..c589b81be491 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[1]; - 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 {