From patchwork Mon Sep 26 18:27:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9351175 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 2C70A6077B for ; Mon, 26 Sep 2016 18:42:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F9F028AC7 for ; Mon, 26 Sep 2016 18:42:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12DDE28AD0; Mon, 26 Sep 2016 18:42:02 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 4F16128AC7 for ; Mon, 26 Sep 2016 18:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755045AbcIZSmA (ORCPT ); Mon, 26 Sep 2016 14:42:00 -0400 Received: from mail-bn3nam01on0047.outbound.protection.outlook.com ([104.47.33.47]:37077 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754192AbcIZSl7 (ORCPT ); Mon, 26 Sep 2016 14:41:59 -0400 X-Greylist: delayed 859 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Sep 2016 14:41:59 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=O6HG0agSB5A/yStvq6RfaGa31YBGage/1l8hfV/YqJc=; b=Wt+gcmVexeI/u+K4KEagpQKpQj8AlG0Fcr4z2pt8JSB5RQwQbRjGv8XDoQLmVagAOs52WgJ78rhWPje0clpPFjR0CFLnUmEsVFq8/2coiaKBnIM402f762R2NPtC3EWG7Rgk8JRbzQFwDDSRear2AVY7afMu5f+zJbJa0X1NVso= Received: from BY2PR02CA0023.namprd02.prod.outlook.com (10.141.216.13) by CY1PR02MB2137.namprd02.prod.outlook.com (10.166.190.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 26 Sep 2016 18:27:37 +0000 Received: from BL2FFO11FD039.protection.gbl (2a01:111:f400:7c09::100) by BY2PR02CA0023.outlook.office365.com (2a01:111:e400:2c40::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5 via Frontend Transport; Mon, 26 Sep 2016 18:27:37 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; 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 BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.5 via Frontend Transport; Mon, 26 Sep 2016 18:27:31 +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 84.C8.26959.24669E75; Mon, 26 Sep 2016 11:17:39 -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.301.0; Mon, 26 Sep 2016 11:27:28 -0700 X-AuditID: 0ac94369-ef8199800001694f-5e-57e96642fd30 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 96.DC.02783.09869E75; Mon, 26 Sep 2016 11:27:28 -0700 (PDT) Subject: [PATCH 4/9] block: Move blk_freeze_queue() and blk_unfreeze_queue() code To: Jens Axboe References: <7948dbb8-6333-dc62-2673-4da35b4dfdbc@sandisk.com> CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" From: Bart Van Assche Message-ID: Date: Mon, 26 Sep 2016 11:27:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <7948dbb8-6333-dc62-2673-4da35b4dfdbc@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsXCddJ5ka5z2stwg6s/uSz+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi723tC3mL3vKbvHsUC+LRff1HWwWy4//Y7Jo2/iV0YHbY2LzO3aP xXteMnk8OLSZxWPzknqP3Tcb2Dw+Pr3F4vF+31U2j8+b5AI4orhsUlJzMstSi/TtErgyuv9M Yik4q1rx5eBDtgbGXfJdjJwcEgImEss+X2TtYuTiEBJYyiSx58F6ZghnB6PEvklzmWGqHu7a CJVYyigxaftWVpCEsECwxJ8fZxhBbBEBWYnvu1+zgdhCAnYSs2a3sYE0M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ruNWee3qcv19Fd6cvqV+8s+3lod4F6Y8iOq cu+FyeduSWU8aw7RT4szTKuJnKM0L3LPZjcNifLZliu4t0h+zigpsNvP+Oilvv1rseBtKVY1 Gx7fWL5Bqb1zmpZf0Xb1osbDjgG1x1ZaZymxFGckGmoxFxUnAgCxwsPgKwIAAA== X-EOPAttributedMessage: 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:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(110136003)(92566002)(8676002)(19580405001)(6916009)(11100500001)(2950100002)(33646002)(65826007)(19580395003)(47776003)(229853001)(106466001)(36756003)(189998001)(7416002)(83506001)(68736007)(31686004)(5660300001)(4001350100001)(230700001)(53416004)(65956001)(626004)(65806001)(2906002)(356003)(2270400002)(76176999)(54356999)(50986999)(87936001)(97736004)(7846002)(69596002)(305945005)(77096005)(586003)(64126003)(23676002)(4326007)(81166006)(81156014)(8936002)(86362001)(50466002)(31696002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB2137; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD039; 1:GC1vkMFII5orncjrQpzs4o0N503F1esEl2uaHra7RWV7nyhdTvVYwUHBdd1YaGZeLY8hfBayxIyiA6DdfnO1MtkL6uWylw2/54teMFhPRtEUlG//IX63I5TYxJfcrImYd0q+eWJK/pagCuQJ9uTO99YHH3P27Avm6Yy83AIhgEGKI5RmoO9Ko+PIToVM7VUlW9lLBdFTMGknRlk764++d7OAgJswOLJS7vmN6YjLkaVeCVYMYV5GBGEKfCzpNI9b8kraipg7WNQ8V/LymUMhxyo8FW8Q2h4JOPHJ4R+OaW+1gnv0JPsbQ0dp2nqB37yyGIKWTyPu8509AcSRhMWkskAT4Hq2kSt0ehhDJZu1GKYs+9Lxj4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NC6HyZCUtgZvxb5moSDagNoU+6V0bDN3d+MMcknu8VQa704gxkRm1kCfR5dtAG7emgpGToG1x7mgi1uRhuryaizm17auvEpp0nH7KvnSZVd4EQ3bHVr4c5eaXBhrVH8AEPSHFXs= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1PR02MB2137; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2137; 31:EJP233UGUAUHvKcBw5vvIrJSCQObFqmJwK+yTLLCk9uhYBP3vQtZV4xbdEvnVmJaOYyYeYcf0SFH51WEaVCMKqIxYNg+XkN2/JNvRck3SzxgCgnuI7oTpuV3lWE/xABUqkiB9Oup95W9w88rv/ayiV+moIaCxxPk9S52csC+Vz4v8505xBUthBe5VmA3khJTHPQW1lMJxvcMK7pE/GEc8jG17iz+3NEugb24ZI6q2Vg=; 20:jaV+LVRYaGMolw9hhVAVPgjzyKMmNXFoUh4Df4ydhMpZXWWPPrEfRlDLQ08iWOg3/DYWUCNLYohcMHQ5O/fgKqX1Mo3Zlg3p5CEYI8vlq6fpU19dhHXdKXs+fGZ9qPzNK6LwHQkL96xzyqFJoGCzJTrv7yDdzno6zfo8tzsza51yLbFyGf+9aKZh3MX5rph+lsuPw0wspvLMZVF5IcsdvY1DuAhXmsOLKcIDy5yTxIUaQmmUAILkMOB5W57mu5eduxm3smnl/7mWD50GM1Us4IK+KD7vsWIe3XwuUDvysD/gL9H/PoRwzaF14bofxWiWBNxxeEFfXsHb6eyiD4mBREbrrgT278BiDp2P93Qx8dJVnwQjFBw8ShIJq8/gylOt+oaH+dpEosBuNs5tAwMS53exv+5R58rSqbZ7qLImCLiBl9K6sziscT3FM5MltlYDs13ZGPGCsOcG5z69/zf3j2d6SSuipVhmnXabZjnyyyQFIsEBPP6EcK9JWxfROy6h X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(3002001)(10201501046)(6055026); SRVR:CY1PR02MB2137; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB2137; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2137; 4:IjcTkYHNu/08owlzdwnFHIgha2z7FBi97P5+6xOf6fr2HI3Y67jELdFrRPzYgKMBw5L2ULIESm9F0Dz0FU137Fs9ozDatdH2k7k2oNb/VqtOHQwhQ1OsRp90VShPU95nl9chtGvUz3wJXMf06CHMwaEnTQuolZkLXMy3ubAgEQuCSoBCe5BVi/zZBh0dxU0MY1fTQkw3/E+wjwahxklvyTidRhrcKwxoAQ4uNw4v83LOYjLM5ZR8vZcp2x2LqcbISsr494h/CVC6VfiMHIGWHKDMvTbMljNOcOoNqHxrNWkhW+aij2FV07HiElcsxzP0OtKmVQsszsoNZM7k+oiPCKqTD6ogMS7hnqhuv1cMynX2s23R6IXGh5ctVwd0TsoNvzr+us5Wq+XpLMtyZsPKnWyYL+MakX5vF5/+zwFzOECjMm0dui0mF9ve9ptaOX4IvMA7n/H19DswWsVKXkaw3BXNCMfYo79j2m6OhfGLwcc= X-Forefront-PRVS: 00770C4423 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyTUIyMTM3OzIzOlBoS0ZFMUIzS3hDV3JtVTZxTHIrVzBVbHJJ?= =?utf-8?B?WURCZGNWcXpGM1JPZ254ajRBeXYvUVhROUVGTUNEMlIvTXdTM0lEWUkyaFli?= =?utf-8?B?RXBjMDU2ZE4vQUYvVnRHNHd0THQvbzFYeFVZVHd6SGhDMjRLTDAzSkdGTmdx?= =?utf-8?B?YmdKT2UzNWdscllGWi9BYjNBK0dnRzNPNlc0UzlwT0JIUEx5ZkVaSUY3Zlhi?= =?utf-8?B?Ry9WRTdzdFMvOC84dEU5QnUwRS9VNXJFaTVodEdiaUxiTDZTL1hWMkFBL0VX?= =?utf-8?B?dVEzQzdhajZUV1phZ2dWeE1sUnZhSFRZ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SbfoceNF37pOC8YK/zX1e6D+50KrmRMeK6QtSt/9LBIWoTQUDv4jDnJoZKzzhdYlJLlvltz3gJxvg5fAO+6QGvozNRNpzvJLoh2bvkPbTJqacdAP7EFXV1nOE7w==; 24:4fhZsn86DChWp9Y6S39+9NmjPPc7PHC9HWBLwHd6mbJXU25I2w04KIdoVqxc11vbJWj7RibBrxmadxhRWsBEnF0BlB4UvyYLjVl0h/J4gI4=; 7:Pt24CA/wHMBMP2NaMxnB3ZXrqdtfQd03xlSpBTs8Qwner/S9Z1GU1YYODzjF1WAi6pXfiCixjBU6TRYEEBUwwF67W/NNk2NAt3wYu3rc9y6RPyUk9pPcrotJrorEu/TT/Q+KSDBK9E1qfe+c7cw5TdlKvUMuuBYdvB7GCYTrDcY7PsW4GCQKj6XZmV6paH2l8SUspF2+lKzpJxQnZWePu83R27qt0TplGgwJ15+K1UnFChEoS+cmfcNLfZ7/aSewd5fqDq6XS5idxJ9qCufkEQA2w+6N4I+yKGDyzCCsleOmsLaAVxUm9F9N7jqMU87X SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2137; 20:rsPC1xBunblzBDAvPip4Xb/8PWgNpvz4wc7FwnOrpSCpG77EVYsWkgY9uGFEVjDHAeaGRHQCTmEL6//4+XUhi/eYOFJPCffv1qYcIS7keRX8T42P8S8gxSub2LF0tNCxHhGKyQ7Ts6Q7bViODaFpwuQhIIQjYyvbvZMngZDWpeKEE94oUtJsh4FPlVmognNJAO46Hn4rZzzG6nrGMGSZB9nwoUAGVvkRgdztOO5o1Tbsqza6eDUq4MKUTOcXnZzM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 18:27:31.8560 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB2137 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the blk_freeze_queue() and blk_unfreeze_queue() implementations from block/blk-mq.c to block/blk-core.c. Drop "_mq" from the name of the functions that have been moved. Signed-off-by: Bart Van Assche --- block/blk-core.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ block/blk-mq.c | 41 +++-------------------------------------- block/blk.h | 3 +++ 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index b75d688..8cc8006 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -682,6 +682,51 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) wake_up_all(&q->mq_freeze_wq); } +void blk_freeze_queue_start(struct request_queue *q) +{ + int freeze_depth; + + freeze_depth = atomic_inc_return(&q->mq_freeze_depth); + if (freeze_depth == 1) { + percpu_ref_kill(&q->q_usage_counter); + blk_mq_run_hw_queues(q, false); + } +} + +void blk_freeze_queue_wait(struct request_queue *q) +{ + wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->q_usage_counter)); +} + +/* + * Guarantee no request is in use, so we can change any data structure of + * the queue afterward. + */ +void blk_freeze_queue(struct request_queue *q) +{ + /* + * In the !blk_mq case we are only calling this to kill the + * q_usage_counter, otherwise this increases the freeze depth + * and waits for it to return to zero. For this reason there is + * no blk_unfreeze_queue(), and blk_freeze_queue() is not + * exported to drivers as the only user for unfreeze is blk_mq. + */ + blk_freeze_queue_start(q); + blk_freeze_queue_wait(q); +} + +void blk_unfreeze_queue(struct request_queue *q) +{ + int freeze_depth; + + freeze_depth = atomic_dec_return(&q->mq_freeze_depth); + WARN_ON_ONCE(freeze_depth < 0); + if (!freeze_depth) { + percpu_ref_reinit(&q->q_usage_counter); + wake_up_all(&q->mq_freeze_wq); + } +} + static void blk_rq_timed_out_timer(unsigned long data) { struct request_queue *q = (struct request_queue *)data; diff --git a/block/blk-mq.c b/block/blk-mq.c index 98d4812..50b26df 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -60,38 +60,10 @@ static void blk_mq_hctx_clear_pending(struct blk_mq_hw_ctx *hctx, void blk_mq_freeze_queue_start(struct request_queue *q) { - int freeze_depth; - - freeze_depth = atomic_inc_return(&q->mq_freeze_depth); - if (freeze_depth == 1) { - percpu_ref_kill(&q->q_usage_counter); - blk_mq_run_hw_queues(q, false); - } + blk_freeze_queue_start(q); } EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_start); -static void blk_mq_freeze_queue_wait(struct request_queue *q) -{ - wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->q_usage_counter)); -} - -/* - * Guarantee no request is in use, so we can change any data structure of - * the queue afterward. - */ -void blk_freeze_queue(struct request_queue *q) -{ - /* - * In the !blk_mq case we are only calling this to kill the - * q_usage_counter, otherwise this increases the freeze depth - * and waits for it to return to zero. For this reason there is - * no blk_unfreeze_queue(), and blk_freeze_queue() is not - * exported to drivers as the only user for unfreeze is blk_mq. - */ - blk_mq_freeze_queue_start(q); - blk_mq_freeze_queue_wait(q); -} - void blk_mq_freeze_queue(struct request_queue *q) { /* @@ -104,14 +76,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue); void blk_mq_unfreeze_queue(struct request_queue *q) { - int freeze_depth; - - freeze_depth = atomic_dec_return(&q->mq_freeze_depth); - WARN_ON_ONCE(freeze_depth < 0); - if (!freeze_depth) { - percpu_ref_reinit(&q->q_usage_counter); - wake_up_all(&q->mq_freeze_wq); - } + blk_unfreeze_queue(q); } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); @@ -2177,7 +2142,7 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, list_for_each_entry(q, &all_q_list, all_q_node) blk_mq_freeze_queue_start(q); list_for_each_entry(q, &all_q_list, all_q_node) { - blk_mq_freeze_queue_wait(q); + blk_freeze_queue_wait(q); /* * timeout handler can't touch hw queue during the diff --git a/block/blk.h b/block/blk.h index c37492f..12f7366 100644 --- a/block/blk.h +++ b/block/blk.h @@ -71,6 +71,9 @@ void __blk_queue_free_tags(struct request_queue *q); bool __blk_end_bidi_request(struct request *rq, int error, unsigned int nr_bytes, unsigned int bidi_bytes); void blk_freeze_queue(struct request_queue *q); +void blk_freeze_queue_start(struct request_queue *q); +void blk_freeze_queue_wait(struct request_queue *q); +void blk_unfreeze_queue(struct request_queue *q); static inline void blk_queue_enter_live(struct request_queue *q) {