From patchwork Fri Apr 7 18:16:49 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: 9670165 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 A4FEE60364 for ; Fri, 7 Apr 2017 18:17:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D6532862A for ; Fri, 7 Apr 2017 18:17:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91FFC28639; Fri, 7 Apr 2017 18:17:26 +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 DE17B2862A for ; Fri, 7 Apr 2017 18:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934393AbdDGSRZ (ORCPT ); Fri, 7 Apr 2017 14:17:25 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:41721 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755907AbdDGSRL (ORCPT ); Fri, 7 Apr 2017 14:17:11 -0400 X-IronPort-AV: E=Sophos;i="5.37,167,1488816000"; d="scan'208";a="105232030" Received: from mail-bl2nam02lp0087.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.87]) by ob1.hgst.iphmx.com with ESMTP; 08 Apr 2017 02:18:20 +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=ju4yDPu33YP8q6qAy0ULjC4qRgQpWB4GHtvN61cNVPg=; b=AYAmN3raY9dttNddiB2P9ZRtwYmAy2UcJ9HWHBqz68IG5fDe3duf+nsJRH8h7Hvg5LJudUO0WnrRDfUm2Zj1BZpSY3LTe47Q8qRvV1VLMBsTuEMGTimGM0GOjK0K9mcgOiKD7jzHwh3NdfjB+NQrZ6SBye2h+u9jdbWdpwC1imI= Received: from BN3PR04CA0019.namprd04.prod.outlook.com (10.166.70.157) by BLUPR04MB103.namprd04.prod.outlook.com (10.255.213.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Fri, 7 Apr 2017 18:17:01 +0000 Received: from BN3NAM04FT021.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::204) by BN3PR04CA0019.outlook.office365.com (2a01:111:e400:7a4f::29) 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.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 BN3NAM04FT021.mail.protection.outlook.com (10.152.92.150) 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:00 +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 3E.5C.29323.B97D7E85; Fri, 7 Apr 2017 11:17:00 -0700 (PDT) Received: from milsmgip11.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; Fri, 7 Apr 2017 11:16:57 -0700 X-AuditID: 0ac94369-548749800000728b-ad-58e7d79b65a8 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 56.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 1/6] blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list Date: Fri, 7 Apr 2017 11:16:49 -0700 Message-ID: <20170407181654.27836-2-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+NgFrrFLMWRmVeSWpSXmKPExsXCddJ5ke6c688jDI685bBYfbefzWLBm71s FitXH2Wy2HtL26L7+g42B1aPy2dLPXbfbGDzWL/lKovH501yASxRXDYpqTmZZalF+nYJXBnf tt9nL3gkWLHhwAGmBsY2/i5GTg4JAROJ6Z+PsHcxcnEICSxlkjhw/i4LhLOdUeLK7HtMMFV9 nVPYIBIbGSUW/GlnA0mwCRhJfHs/kwXEFhFQkOj5vRKsiFlgE6PE3Wu/wbqFBeIlpt5vZwax WQRUJJb03GcHsXkF7CUO/d/ADLFBXmLRphlAgzg4OAUcJJpbFEHCQkAl+zcdBbtIQqCLVeL0 mh1MEL2C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tering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(2980300002)(438002)(9170700003)(5660300001)(77096006)(1076002)(305945005)(53936002)(47776003)(48376002)(356003)(189998001)(5003940100001)(50466002)(106466001)(76176999)(50986999)(86362001)(4326008)(2950100002)(6916009)(6666003)(81166006)(33646002)(50226002)(8936002)(36756003)(8676002)(38730400002)(2906002)(110136004); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB103; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT021; 1:I5keE09urlMl9CJim2isy4PvxgZ4lngAIOu4oEFFnpe66GdvqujcGclKjH+cXFPJAH9bewgBeEXvTY0ennIQg6J3SyjOrAnUo3E2peH/qTjjVejjQu03f2z6PumDzYrHSuSkdlBdJXx4djLg4tep2pyxeQa6jqpu4TyhglwbDgj9MMbGevXySGXVYuve9xwi7POcRV23/2WoF6NRs4Rq6hM3rz5Eq0idsWUrZSix3q2ENhUzqH4TEZb/76Tru6+4jWTA1FRLaaW+4w76k1pKIPy7eeKqMINxLtIAK+AWcrNe3+HzN4MlLtIpUHvt9sB5h9x4l0KzK1nt5ydp2Ihkwew9sChiaJXwJ03RuqkCFI4IeQBkXvNmJq3bYtoSMDOIzopkYyjAUQMS1f0By9NK7UeSNfOFwlBpzRyVyWu8BvvzFNjni+cwvH/M1Fgwn/+yHM1fIEZIXHB24Gj2xDF205y76fbvYOmRmIkSHX9OK7tzBMhUN2xENNXVp+hGwaQlKakGhma5ZcAnDhlHCothNvoU8UAsWWsAwOoWktQRXgc= X-MS-Office365-Filtering-Correlation-Id: 58005e0f-3d3f-41cf-3b93-08d47de249c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BLUPR04MB103; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB103; 3:PKo4FlLa6nxSuHFblWkiGWOK5zW+KZNWUIy2tw3Fy9jQWrZLTvCE8JxYaY41CVXMhjvo0N57dBjiiKftB/TaJ2aOAVKL+0UKX7WlvBTUHOe4BJ9hY0ik9nVhWevLCJMmUrAMSSOXlp2TRUesgRvQkaB9lmlYW7qt8SDfAxvr+oWZKOz31LYjV6sxjlApe74r0P63YHEEYrRDwuRuNfpIq5xMeVaXRzI5ZyjHC092SNBEYHzeoRa9hVuApQy138yyJCiS64E1v3yIds+ftjhhZWhI5Et2M7YO8T/2bear+gluJmT9fWG4SzbiGBkz0K77WjPWCatA1g7CSe+JBIJRS24PfQcPQSSg35169J6CciwC5dopWUB6aOrol+yunJDw7TTeeU9lOVhLBQvVSTualV9CVib5g7uTwOkxKsvP3sd+yroZoV7oEMzCHA+frEjDa/NH8uOtPV7jopW4GmYTDFxilIVRjEJDLkGA6HU1mVTVDIj+r3+3Is2U8earzXWD X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB103; 25:DwG3jjgubHOxCtbQWhUsDlLK/4xPk8usDL9IvEWdwIm+z5u0ziRGVlkSncwrqQC/PIBmyllHq/OGc9hQp1dKaNwzQYipc6/4eE/ypzwoeiKbKhGHyoI+mBqhUZlYikHWuOd1BdZdaym6aFwTBJ3kyIxodV9W6PAD1S3VnvsIWNVOBNLRMn7u9x/CS1ljGvth4fymcqdpnni21auIjO45JlAX3GfqLKcIaEWRub6s3njWbYf1Zyc7A5D5VcljOGnO6SUdJOYf1aKdFjuANz8YjsIkwQlEJFigiJUyqUHPp7lRUwCFMzQskUaHEUSI50MunaZNqNWinLHvFKuf01Tm5H0X2boTohbLL9dnPpQtwDgenqFXFw1Zch0mvtbCngRd0dHdb9colG0bbICDYvTQ9viUr+nuTvcaHKksRQE/LW9+kxRNgqa3c29Jj5df4UcqF+6Nb+EF37BeJV2tfRSDlw==; 31:Z98Eub17dpA4e14CljnvrTaLKXyOWjI/13Kv04XexefzefJ3OFm2RLOq5qFj/+ywFF5Evnphl5hY9xc8S3W0GuShPMX4WkOd1MtlCWV05Lt2gCg8dQ8L/WZE2YoHAenhR50AG1UPYHZtfEawYuxGeY8jWGFvl5l9ncerZGxqXVVQFaTBSvT02ujD1lWkIHukOWGoDSFTBn+uY1Yb6hdvC7TU2NFaT5u8zMFVERPj6uHYYOAyp259K3KSr3vsUcqUqf8nQgrgQAIMOOWdc+6LMy+cADFZmnWd6Cm71YL9Qi8= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB103; 20:54UPmCC5magxMSIQZEB3I93McI4L6cyC4h3GYkgmZOwFb8blu2R2SDYmhnQwDZYoTmjQbiqhRxNjf3Q8W1QVcpH3dKMf5Vv7/FnihgxIEin2K5zXNlkV5hsQuTi8q4ZS/nDWp7PUWnJ5dHvH+U2CNdzdsXvrsu9k0E8ZiFPh8EnJSGP8VHTZ37HAlLpx3kM4nrI8pOTRbZEQpNWMT3GfO3F15SAyTD8/Hkz8PRyOGh6vjtllcoAxie+Wp9mAtj9r3sVqvnlAyoCzdTu2drx7lHiPbklsDAbWYIlgf3/qlCcUmqKyWlqmQzcpaeeeLVNalcquj+QGlTq7VCVqNmj5/XMpvOvStLbWBBPYl7n49JBMThHxnxZ0nl94uG38B17bB8FcaShkpS6mpbeqcB4VAY2ZsaS+DCWh7bFDkYpUrBY6/WZSmTxJmMqVlY8P/vqhVeFAOrP/z7TWZTN7ECKfQHwWKCVtNWE0BksmlRkp/HB+rn9l2Xe0/8amYxduVkO4 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)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:BLUPR04MB103; BCL:0; PCL:0; RULEID:; SRVR:BLUPR04MB103; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB103; 4:l8Io93iZzegMWClVH3mp7Uby4Il0anjorzfsJZYugkoJNbX+7fqtHA33+ofLXPNUijyOmZICmDWbKhTFhxSMFHDkd8assZOy9ZveuX/QRmGfopdezzkHJQTFTCXermvhDuY4JWFS8AyasjfQK9A8tVbH59jBrlem5UgVX37i6IgO4bpaud+KJ7JYIeYMzRc/Y3xqaMuzvC/fuY82dJ5chUZRHsnvEo/XFoWthKY9uD5QRNNMtdjkTR6UT1T+duKvqkckgX+4UcP0UC4IrnlO7uqrKEq3JM8YlQ7eSGPxTUa3bIFmUwZR0cwGU2QUoIEA5cIO9yfD5NmQW4pU7UJUH1sAmCM7yXV2Sbi/4CFn4njNgYa3K6TPBo2QqFOIqkXutF4wgyXH8cNArPZifgxIvcpaKzUU7+TRlvFJkbPfOIhyM6anhxEXtPExk8egLUwtwh4F8tiEfkiC/cpQvNwdEuYT3WnWpCSQxmcaiMISqZ4f9vPAMk6zODRNW6mym0uB3d+rjz6CTfe2jJ9WySdHzscRCY4Bd+gcxK85MMk0HMY3CzWGexM0y7xBvgMN5gdtv5Z1gVcZmcsjqUvpf8UdbjYcKZMDQlLIJlAKRhAfzvTktyg4ZESDzCubhI9PrAIU2jsujhX1TiwjNP51OKesJsQnhjDKygpAKlwglnXvDZi0mR9p0UowB11sMWHR4P8C2ROtoxhTH1tfejp9V+ygx9MrwyheFh/yv+T0KL17otg/AYn8ZBEeF13zszUSjfX5X4aEupEE94IbHo55g6FVukcPP0VVLKdVmKP8DmG3hudg9GBn0dBOJuWZk9df6NwT X-Forefront-PRVS: 0270ED2845 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB103; 23:DsrpIzlthaU76V+OiXa+ktqtCStKfmgSbjyzeEvwom?= =?us-ascii?Q?ICNFBokquKL4aDO/6o3ISGr+gxz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8A1ZF8PZND6ruavJOMxjFgrS0BHlnntJXlhAg1omrrdMJ0VS5c1cctRw/YyJWhV3bN6zNSzZdhJd8u/M1PW5fgDwgNrOqnm7tHbgwUAD9snrtMva8rE3c/veBqzMutuCX7BQUPnnADwhDZ4owlcc1li7y3LIJskIXRA==; 20:d6glA1KepXJqHD+ozRrEnLv4jCzJ/iQ1qcrLV5WVRNj2E/gAlOHXAT8MuSlvtOB5zB/1wV8AbNtp5+KX/pxOFAhkhg+pgFKmGcpcOpkHcJCv+qceHtTEiaobXpNh2/MlSIH87CJYprQ5doYLxTyNXNlM13wpd3V2dgPruNllO7g= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2017 18:17:00.2612 (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: BLUPR04MB103 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 next patch in this series will use RCU to iterate over tag_list, make this safe. Add lockdep_assert_held() statements in functions that iterate over tag_list to make clear that using list_for_each_entry() instead of list_for_each_entry_rcu() is fine in these functions. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index f7cd3208bcdf..c26464f9649a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2076,6 +2076,8 @@ static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set, bool shared) { struct request_queue *q; + lockdep_assert_held(&set->tag_list_lock); + list_for_each_entry(q, &set->tag_list, tag_set_list) { blk_mq_freeze_queue(q); queue_set_hctx_shared(q, shared); @@ -2088,7 +2090,8 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q) struct blk_mq_tag_set *set = q->tag_set; mutex_lock(&set->tag_list_lock); - list_del_init(&q->tag_set_list); + list_del_rcu(&q->tag_set_list); + INIT_LIST_HEAD(&q->tag_set_list); if (list_is_singular(&set->tag_list)) { /* just transitioned to unshared */ set->flags &= ~BLK_MQ_F_TAG_SHARED; @@ -2096,6 +2099,8 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q) blk_mq_update_tag_set_depth(set, false); } mutex_unlock(&set->tag_list_lock); + + synchronize_rcu(); } static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set, @@ -2113,7 +2118,7 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set, } if (set->flags & BLK_MQ_F_TAG_SHARED) queue_set_hctx_shared(q, true); - list_add_tail(&q->tag_set_list, &set->tag_list); + list_add_tail_rcu(&q->tag_set_list, &set->tag_list); mutex_unlock(&set->tag_list_lock); } @@ -2601,6 +2606,8 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues) { struct request_queue *q; + lockdep_assert_held(&set->tag_list_lock); + if (nr_hw_queues > nr_cpu_ids) nr_hw_queues = nr_cpu_ids; if (nr_hw_queues < 1 || nr_hw_queues == set->nr_hw_queues)