From patchwork Wed Oct 5 04:16:30 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: 9362487 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 CAA82600C8 for ; Wed, 5 Oct 2016 04:16:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6927286C5 for ; Wed, 5 Oct 2016 04:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA50928733; Wed, 5 Oct 2016 04:16:48 +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, T_TVD_MIME_EPI 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 18759286C5 for ; Wed, 5 Oct 2016 04:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbcJEEQq (ORCPT ); Wed, 5 Oct 2016 00:16:46 -0400 Received: from mail-cys01nam02on0048.outbound.protection.outlook.com ([104.47.37.48]:23920 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750992AbcJEEQn (ORCPT ); Wed, 5 Oct 2016 00:16:43 -0400 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=VNRw1OfB0QtlCBIXkp44C+zPHFa1C+qofSnB8+hIcxE=; b=LtcOU/rjIhCHi8lcMAEaq+uPmyDvOr2ODBFrzKOow62xmA3i/RRyi3YFW0J8fIQZyTIW0svSARWdyT71hqlX/RElGJZtFsb/ENrH5W1MudlGFIiQgsyiwc6F/NLrpTcRQg/B17LSEipQ7ZGTpQGIoyj1p+2OkPHaU0RMZ+66SlU= Received: from DM5PR02CA0069.namprd02.prod.outlook.com (10.168.192.31) by BLUPR02MB1619.namprd02.prod.outlook.com (10.162.212.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Wed, 5 Oct 2016 04:16:40 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::193) by DM5PR02CA0069.outlook.office365.com (2603:10b6:3:39::31) 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; Wed, 5 Oct 2016 04:16:40 +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 BL2FFO11FD057.mail.protection.outlook.com (10.173.161.125) 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; Wed, 5 Oct 2016 04:16:38 +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 9B.00.26959.34C74F75; Tue, 4 Oct 2016 21:06:27 -0700 (PDT) Received: from milsmgip12.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; Tue, 4 Oct 2016 21:16:37 -0700 X-AuditID: 0ac94369-ef8199800001694f-f2-57f47c43c006 Received: from asus.site ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 7B.E6.03606.F9E74F75; Tue, 4 Oct 2016 21:16:36 -0700 (PDT) Subject: Re: [PATCH v2 4/7] blk-mq: Introduce blk_quiesce_queue() and blk_resume_queue() To: Ming Lei References: <9fb67745-954c-a70f-a89a-d184c99ae9aa@sandisk.com> CC: Jens Axboe , 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: Tue, 4 Oct 2016 21:16:30 -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: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsXCddJ5ka5zzZdwg6fXrCz+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi723tC3mL3vKbvHsUC+LRff1HWwWy4//Y7Jo2/iV0eL9j+vsDjwe E5vfsXvsnHWX3WPxnpdMHg8ObWbx2Lyk3mP3zQY2j49Pb7F4vN93lc3j8ya5AM4oLpuU1JzM stQifbsErox3jRuZC/oMK6Y8Ws3YwPhRo4uRk0NCwESioeM9WxcjF4eQwFImiYfrX0M52xkl lj56ygZT9fnhEhaIxDRGiUszrrGDJIQFoiTWLHjOCGKLCKhIPOrZDBYXEtjGJHHunzZIA7NA N4vEsznvwRJsAkYS397PBJrEwcErYCfR87QCJMwC1Dvpei9YiahAhMSthx0sIDavgKDEyZlP w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jKYOhnGHVBPKZmn+W9grPfvTlwaZPL4fRYZpyTNeeF84xnTr+4HzjZmdu5S3pC99dLnS 7cuTxsL6gAPiSxj0Ej7bh/3PPtW3SjnQct+Er0osxRmJhlrMRcWJAIYdvQEdAgAA 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)(24454002)(189002)(199003)(7416002)(512874002)(586003)(8936002)(84326002)(5890100001)(76176999)(54356999)(50986999)(4610100001)(65806001)(11100500001)(356003)(93886004)(4001350100001)(5660300001)(31696002)(86362001)(65826007)(83506001)(68736007)(77096005)(2270400002)(189998001)(6666003)(5000100001)(64126003)(87936001)(97736004)(65956001)(110136003)(69596002)(626004)(2476003)(305945005)(2906002)(8676002)(92566002)(2950100002)(270700001)(106466001)(568964002)(81166006)(81156014)(33646002)(6916009)(36756003)(7846002)(31686004)(4326007); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1619; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD057; 1:qgCw5R+GPWlxAi4pxTzEU/CSR0z/cpYlJiUZcAjvaYPbXNnamgiQcRFwQExjNzmYgbT9+LCD7uH8v4KOuK7d59ndDG8T0hzhEQ8Tf/8uB9O5A+hLraWS7HJOhhH/eYGzXKWULX5DMmneym2CPgRyMF3oxG0YpXR2l3vKAPWWg/vBMDygRW6Z1bMynV7UNzWSAfq+CBMRzcwY+JOnVDpxV1rrdTHoeYj7dIpMUAHpISfCMGwcN2Q4GnzPTVy+AFRr/gKayI3ZESO4HxHev3Aa8z9DfTIg8C6+6aQ7nHeLpYjiIjB6zE7Umg8TFpUpM33lP0efHKfkS8Zfgtamn3S2Wj7yZDA705VwcMoKjSJWXox1wOR84VQNOIt2ZuPBDyRSpkIuhWrwTr5vxBNiRy3HRjRD6Sihs6U23dM/oMom1aTGvyuj2UDFDvq8NheTFRCSofa/Dc/5egpeXQrOzIg9WtruwmsE2aUykPr5i11giQky5faguCNlI7WG2CPr4nRbUd+fPOKhZJUUH5hq0pILkE0h3wshC+sR5O8re84EGYvHyPMfip/Jk2BBZqXbcf0Q X-MS-Office365-Filtering-Correlation-Id: 47c72910-12a1-4a0c-dd58-08d3ecd667c8 X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1619; 2:QwHyX65k9bDQ97vt7bMJKqdcdkL3+UMdbiyutSs0cK/jjLib+Z+BjbkcbfGFTuaheq61MyaYTc0Tix2CnPTm12fEJ6p/GLhcdUVuR9EzFMgxhxWg6DYEpXIM2ubeKK6r2LAE6M8xRa4z+PeLajZYiomCgj41D+wPFiC8toJ4YfFxK5obr8NfN6caLmS77MSkcGVI5FXoCdKRdAkQuFnENA==; 3:AfzU055/KvYGuT4NsA8/HGspJkT6ndtp2NHwAPfkudv24YgjrwDlHVuf359PmsqJcB3puJhTsf8YYlJx/dNzQRyIkeqOdOhW76OxIE50YS1IgC2ufT+NveLOgwsp34CeL18LT2/m5LPWEej31Fvk8GMEit4qqkx9yQ9UZX8stX0pUf4c6uxMGmMbgr12tCOcgn6k3LDtpT+XPwECAGno415pa7VHyyp0flTt1aSC1z64YL7oVybn/JwHEUeu4o7TloyoCZeQfQjaItwRQJFQ/c2YvCWxoIxcw29+3N0oOkQ= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BLUPR02MB1619; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1619; 25:H1WUm4J8sSO2YOUxJU4o1vsyX7hhBhUk3aBTBnZCyKONY2MeWa58diIc1ranlo+5eeDj2rYnTQuOEADfYO1xnWbSm5JqXHo9mDWiX4XGgZl7hcDIkU3PRMPMdx7PqWYCefYWfG6SrOESJIBYN2QjV0hLnIYYKygFrg3jvlIFoL+VoPBX2xHq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2fuIYXj9/WeI2yZIPcX2DUWQEIHuFhH7I8CpPbtPA+mIKe76L8jezeIWPs8P+Chjn+7jPqkG7C8YDcDcmc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415321)(6040176)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BLUPR02MB1619; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB1619; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1619; 4:jChPwg6lRAjFHKsOZncPQPj4pEJmB5oRy67g9OAdeywlWT02G2t3InImO0UybOFlQEkEwOLQM8c3mN/FWueoLnH3cM/EPEP3ipSeC1PCats3rOkx2GDW7dyh0j7Jkcwp/rKaQCm5wzGc8ydfXRfyzsKGVDYdJR6oG4nGrldE2qL6EwoHaMzcwpKj68ZN4dDb68/9QrzX/eeKvXCZwrgzRC023WaXl1Ste3qGDVI78si9F0xyXyDE2cMYs72b5jAlDimIhwMa+RvKHFRnPPDuE/l16nPAZw/1GQeWKxEl1ct3dDP0YUrrWfMgbZ/SHg3MyNUThMDgFcLPR+ovo1/9I3z1xekSaVnrgfP1s6CeS7tX3QJqF19YlEzRXp6YttDH5PCS0tFmG+Z42yeInbHgIewRa7+R6x/W+okKwynJcc/1aUKlmJMGg/8YzegEUGcPVy54ztZHsRMWRX+PQ5Y176myu37r7SU+GmE6j685mDQ= X-Forefront-PRVS: 008663486A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR02MB1619; 23:h5+JRlcRY9Ry3Yuwx+hcYAP4TrRoMGr7GdFNrY4s4?= =?us-ascii?Q?vEbLcq3nyqyOIIyCrAIj6wiM8g2JUowV7aIkYOG07hFuMBb+Ni1JIB0rm2Ox?= =?us-ascii?Q?z1Gyqao9f1zoxGLHy/cVMt7t1MjkQkaOtESYn3XuNLnkr3WTCwPu59MDMhoK?= =?us-asc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LcMblhq1o3l4JU2bAr+WJLiFzfZgS1F2M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1619; 7:qxR6HcV4v+BZtE7fbjAiYdJWI7FYPfVWEVWZHyW+NuvNvmcFqMtOAiTDH8Oo4e6DNcatrNzbjGv4f96wiW/Y+GsNrzUU2FESzCUTazYk4JM974nTa2ZDCoBtCP8ApTaGMkR6E4DVWlwWuAUwKlrMps5k7sXvw/KU1g4pBX+GxKf/68j6QO1kS2VEQgddoUXYV9uihuZsLzxWXHn3B9NkUIW1UY/qTLZJRiCKmMTOZYcLLbRrS2j8Zw7PEe0k5qnHKaUq+LJdYkY7yrHrxiv4Uf9LL+Yynm5StOIunxwryZwW6gCdKuaD0OK/uluBW/Q7RiuxlrJSc7ya8qfFDZKdBQ==; 20:FbGnNIc8MLzNHeX+i50HBYIjMpya9ZaT/J7qm2xWp380aC5R7RCGKHr597EwJeUHnj5vhhmJISrK55CpZbzH3O6dBkkG4eGvL5UfZcbKdp0d/SvMne5gAewxZJdOdZrx4M0XDwlBAShbvtHmpPT3dptMs1N+3X8RkopKnyhYdn0zPNCJOZb7IdiN+abC4/BIWXDu4l5E2MSzv1nDYuKhBGwlE7R1+PyhRU4iqCXse9IVoDI9adq5Ivqtunpvk+UT X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2016 04:16:38.7293 (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: BLUPR02MB1619 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 On 10/01/16 15:56, Ming Lei wrote: > If we just call the rcu/srcu read lock(or the mutex) around .queue_rq(), the > above code needn't to be duplicated any more. Hello Ming, Can you have a look at the attached patch? That patch uses an srcu read lock for all queue types, whether or not the BLK_MQ_F_BLOCKING flag has been set. Additionally, I have dropped the QUEUE_FLAG_QUIESCING flag. Just like previous versions, this patch has been tested. Thanks, Bart. From 25f02ed7ab7b2308fd18b89d180c0c613e55d416 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Sep 2016 10:52:36 -0700 Subject: [PATCH] blk-mq: Introduce blk_mq_quiesce_queue() blk_mq_quiesce_queue() waits until ongoing .queue_rq() invocations have finished. This function does *not* wait until all outstanding requests have finished (this means invocation of request.end_io()). Signed-off-by: Bart Van Assche Cc: Ming Lei Cc: Hannes Reinecke Cc: Johannes Thumshirn --- block/blk-mq.c | 40 ++++++++++++++++++++++++++++++++++------ include/linux/blk-mq.h | 3 +++ include/linux/blkdev.h | 1 + 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index d8c45de..38ae685 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -115,6 +115,23 @@ void blk_mq_unfreeze_queue(struct request_queue *q) } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); +/** + * blk_mq_quiesce_queue() - wait until all ongoing queue_rq calls have finished + * + * Note: this function does not prevent that the struct request end_io() + * callback function is invoked. Additionally, it is not prevented that + * new queue_rq() calls occur unless the queue has been stopped first. + */ +void blk_mq_quiesce_queue(struct request_queue *q) +{ + struct blk_mq_hw_ctx *hctx; + unsigned int i; + + queue_for_each_hw_ctx(q, hctx, i) + synchronize_srcu(&hctx->queue_rq_srcu); +} +EXPORT_SYMBOL_GPL(blk_mq_quiesce_queue); + void blk_mq_wake_waiters(struct request_queue *q) { struct blk_mq_hw_ctx *hctx; @@ -789,11 +806,13 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) LIST_HEAD(rq_list); LIST_HEAD(driver_list); struct list_head *dptr; - int queued; + int queued, srcu_idx; if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state))) return; + srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu); + WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && cpu_online(hctx->next_cpu)); @@ -885,6 +904,8 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) **/ blk_mq_run_hw_queue(hctx, true); } + + srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx); } /* @@ -1298,7 +1319,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) const int is_flush_fua = bio->bi_opf & (REQ_PREFLUSH | REQ_FUA); struct blk_map_ctx data; struct request *rq; - unsigned int request_count = 0; + unsigned int request_count = 0, srcu_idx; struct blk_plug *plug; struct request *same_queue_rq = NULL; blk_qc_t cookie; @@ -1341,7 +1362,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_bio_to_request(rq, bio); /* - * We do limited pluging. If the bio can be merged, do that. + * We do limited plugging. If the bio can be merged, do that. * Otherwise the existing request in the plug list will be * issued. So the plug list will have one request at most */ @@ -1361,9 +1382,12 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_put_ctx(data.ctx); if (!old_rq) goto done; - if (!blk_mq_direct_issue_request(old_rq, &cookie)) - goto done; - blk_mq_insert_request(old_rq, false, true, true); + + srcu_idx = srcu_read_lock(&data.hctx->queue_rq_srcu); + if (blk_mq_direct_issue_request(old_rq, &cookie) != 0) + blk_mq_insert_request(old_rq, false, true, true); + srcu_read_unlock(&data.hctx->queue_rq_srcu, srcu_idx); + goto done; } @@ -1659,6 +1683,8 @@ static void blk_mq_exit_hctx(struct request_queue *q, if (set->ops->exit_hctx) set->ops->exit_hctx(hctx, hctx_idx); + cleanup_srcu_struct(&hctx->queue_rq_srcu); + blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier); blk_free_flush_queue(hctx->fq); sbitmap_free(&hctx->ctx_map); @@ -1741,6 +1767,8 @@ static int blk_mq_init_hctx(struct request_queue *q, flush_start_tag + hctx_idx, node)) goto free_fq; + init_srcu_struct(&hctx->queue_rq_srcu); + return 0; free_fq: diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 368c460d..b2ccd3c 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -3,6 +3,7 @@ #include #include +#include struct blk_mq_tags; struct blk_flush_queue; @@ -41,6 +42,8 @@ struct blk_mq_hw_ctx { struct blk_mq_tags *tags; + struct srcu_struct queue_rq_srcu; + unsigned long queued; unsigned long run; #define BLK_MQ_MAX_DISPATCH_ORDER 7 diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c47c358..8259d87 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -824,6 +824,7 @@ extern void __blk_run_queue(struct request_queue *q); extern void __blk_run_queue_uncond(struct request_queue *q); extern void blk_run_queue(struct request_queue *); extern void blk_run_queue_async(struct request_queue *q); +extern void blk_mq_quiesce_queue(struct request_queue *q); extern int blk_rq_map_user(struct request_queue *, struct request *, struct rq_map_data *, void __user *, unsigned long, gfp_t); -- 2.9.3