From patchwork Sat Oct 29 00:21:14 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: 9402917 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 0E780605EE for ; Sat, 29 Oct 2016 00:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFAE02A8B6 for ; Sat, 29 Oct 2016 00:21:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E38FC2A8FA; Sat, 29 Oct 2016 00:21:24 +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 778912A8B6 for ; Sat, 29 Oct 2016 00:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938605AbcJ2AVW (ORCPT ); Fri, 28 Oct 2016 20:21:22 -0400 Received: from mail-sn1nam01on0082.outbound.protection.outlook.com ([104.47.32.82]:54438 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935767AbcJ2AVT (ORCPT ); Fri, 28 Oct 2016 20:21:19 -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=XPHXn0H86FRy9ZvnvToB1hF4bEF2j8sCyXSLJ1dtQHM=; b=fnYokXcNBDeEFLo3plevkJqTgpqIiqQgR8pbF5UKrx0kyIkN7LwgBMJRURP5p6VfUqlgBN7EMOSzPttrfre2+3EwpHBHNfiVy/rNbsbBMPcR1hl4pSYerFCEHt2qeyUlKGPfzXRqd6Fhgnjll8EVLuDtOCJQGqLkhcMlJNQc+7c= Received: from BN1PR02CA0014.namprd02.prod.outlook.com (10.141.56.14) by CY1PR02MB1168.namprd02.prod.outlook.com (10.163.15.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Sat, 29 Oct 2016 00:21:16 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::122) by BN1PR02CA0014.outlook.office365.com (2a01:111:e400:2a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Sat, 29 Oct 2016 00:21:16 +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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.5 via Frontend Transport; Sat, 29 Oct 2016 00:21:15 +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 2D.A0.61581.729E3185; Fri, 28 Oct 2016 17:11:19 -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; Fri, 28 Oct 2016 17:21:14 -0700 X-AuditID: 0ac94371-5f3ff7000000f08d-01-5813e9274ebf Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 73.4B.03615.A7BE3185; Fri, 28 Oct 2016 17:21:14 -0700 (PDT) Subject: [PATCH v5 07/14] blk-mq: Introduce blk_mq_quiesce_queue() To: Jens Axboe References: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , Ming Lei , "Konrad Rzeszutek Wilk" , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Laurence Oberman , "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: <81a7e98c-51b0-99f0-c143-303425508bff@sandisk.com> Date: Fri, 28 Oct 2016 17:21:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsXCddJ5ka76S+EIgyvXFS3+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi2WLnzJa7L2lbTF/2VN2i2eHelksuq/vYLM4/+EVk8Xy4/+YLGac X8xq0bbxK6PF+x/X2R34PV5PnsDoMbH5HbvHzll32T0W73nJ5PHg0GYWj81L6j1232xg8/j4 9BaLx/t9V9k8Pm+SC+CK4rJJSc3JLEst0rdL4Mo42fOHteCnRcWt6avYGhhP6nUxcnJICJhI XPq/i6WLkY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wMYjMLqEv8mXcJypaX2P52DvMERr5ZSFpmISmbhaRsASPzKkax3Myc4tz0zAJDI73i xLyUzOJsveT83E2M4JjhjNrBeH2i+SFGJg5OqQbGrsIWozfLxVSW/fc3q7O9L/Z2fWBPdm2M zOGn3JuPuYUqPeQvqmu1/GbytiHucMnv4E6tdu2SSbKTt5SySjzbOWHzq1nzlssc1+Aosrvy /ETy2W1XVA62nEpSiDy9PKqbY4PtjgVbre+IhT5KMDrdO9n5K/fXh3HRfyatKrRbt+sQ020T 1phCJZbijERDLeai4kQAuiC260kCAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(6916009)(2950100002)(23676002)(110136003)(92566002)(77096005)(65826007)(5660300001)(2270400002)(586003)(8936002)(2906002)(83506001)(47776003)(7416002)(65956001)(626004)(69596002)(65806001)(87936001)(230700001)(54356999)(50986999)(76176999)(86362001)(4326007)(53416004)(97736004)(31696002)(4001350100001)(189998001)(19580395003)(31686004)(19580405001)(81166006)(81156014)(50466002)(36756003)(8676002)(7846002)(8666005)(64126003)(356003)(229853001)(68736007)(106466001)(305945005)(33646002)(11100500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1168; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:bUNmwpXBLbo+sfE9tuWe9+4rvOKqUeweFSr1DEJpo90xOvQ3iJcJeP3bv1X/+YsK/ekwvlebMTYchB0vpzLFx409fziqrv6z6h8Li0DM9fMf+ovC6qKUABp7kQ/iluByeY8tEWx3bWGUcbwYiK3rilZwIh3MxzVMOId7DISiNfqrLwYFavR5RhshN6aXUBXkxINNfSJMCarzZ3VplcycOVHTH1MyB4f52+cjo7qvDp3G/xufuc+n9lGNNYc1Y3cSCX+Nlu1tFGxEiArKVwTW/+Jw4kE+L/gSLfkITONahuNt4fjoDnpv543z6z20+ZbkghYp6EXNAr/azW7CUxjB7mdUsoNyGMYFOO3vdQ55cmx/YrHga8bXqE5woJgua7Ri8tEom9hROqawETH6jkT2fFnIOmcU2WT9nwwmwVJgERHYXTpRLA41nKPzYt20K3wE2FgTX8BXk6X8pmB1s6hm/duQc+EMoFjD4KBEeUb6l6KrUGjbKJ74ZCHTrAKc2VF3wLg1ZWHe9mozqj3b2+6wCRGdnWs/3tS+Jfs73G8HNd5usPddz1Kq6jNY8q5n4tte X-MS-Office365-Filtering-Correlation-Id: c60a8f61-f4e5-4209-0ba4-08d3ff917f1e X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1168; 2:1DBj6vShR65HpI1rtq7Z0P+Tu+za18o99TkrWtxereXEXs4kFmdeuUgKqdcFNLlShPupq00/ZE0/uk+I7kXo88ZECiEfBgWyzyuMg5SBtbqEX6fXPWXrx8EF64WBmrSqi7OMADxNVv9LJiD5KasOQ+KWPDGS672tylmNJ3TR6+OQD39+q8GVQ4YBJ7yJR2dpwC3Wcd2nsXSCAm7RwKxohg==; 3:1d84EGGNaSYTJucsHlLb7WwnfbHfdmocdu6JDBlPNWF39UY1lw/bsU1smh/hnDWjXYa2di1qJl6yqMWtQHhlVF4sqezTx2jFwaNrB0kpCmNfLH1UBead1IzlJpVP+X2cXt57knmjqWbTVvOKl0ZQCcnoRaUDbcRbV0C2nblR3o0jjl/7aUi/9oCIhKynNCIBohTYCsePgLJLECUY0u/u4WnlxLmwllInBreIQLnrzpsw2IlgtLxxcGZCNqaI6K7TbdmKurQrEVv7ostEGsWeAhoE71RE3gten1mqk+nosuI= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1PR02MB1168; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1168; 25:E1KQ38S0VdDgJ6uVwnE7k7t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5ywKuXFQRquys6lkwtxsm+Nj2LSIcHdtX+I87rrIHfP9LC1ohqkmFwQ92lxp6kMs48Q2CI+xJ7LboGJMkRscQYXxWaKesMNqNAh5Pb3TyuRnKVaYrFKHXIEpSwq14mEljt/g2X3uARm2nCE9T9+XhxXzEMowXD2TTOhluHropVkBFW 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)(13018025)(5005006)(13016025)(8121501046)(3002001)(10201501046)(6055026); SRVR:CY1PR02MB1168; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1168; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1168; 4:6X0f48IjXEw/6z3QHu5+fv4daKNnq4IoAIdBxNF4B4Y8pMJvXN4Dzo7jRM3sex/WdK1hoO/MMm1ow5UuLzziEVtcs4R6D8d3AHQtdFwznrxFBB5bahihMfvQ7t3ycQxFztlGE0gPFvvVjup8eNjWe/zljLe5e2Zgz1dt1uwSe33unpCIvKsVd1CUt/Pjh4iO1OS0HBVao1DlsqklvKPqogX0u9dCiF/SKkYlqLQu2SgILlRaw8YbNjPCzJnZSMux9ALkQJ5JWoTSOlWS+VbmdGVl+UyrtTFeMxirX/2c3MQ2a5VfQ8kQcwIZAZOvgA74Gb5s8jBbLEubNy9UN26ENsT0rlYAmUyw1GAVDxaC6RkukfR49TBKFXO0B6lvWvOV1AJKwEbh540twA4GB1u0gzogIDGfeoin4E3K2g42+dzDqFJVrtFNFg9wkeNKeUoHthDKdc+akz8tWb+RA81WZSEihomufqXBCwZEephta5coJrmPgKA0mOS1dm3EfwFl X-Forefront-PRVS: 01106E96F6 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyTUIxMTY4OzIzOjExVGZFWHFiMnVoWkpnTmF2NUhEOHlQVDRX?= =?utf-8?B?M1lCVTc0VmM4STZGcUhSUVFCNnlBWSt6Zn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+z+U7Oik5eaKPql7Yib3sDK1LcWEutuKnkxsnOVQ8GRd+y2MALe8x/jVn6XjZbGGvOh/16OlinlolF1SV42M5+Nait4td6SCAeNm4X7uv3SaUOi6VNWfrHvYMKmhvrYxrZmPE/25gMoQXSeaFn+zkiXzVz/RviwfwC7l002GOTmZ2lmRN4INBYH0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2016 00:21:15.6296 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1168 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 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()). The algorithm used by blk_mq_quiesce_queue() is as follows: * Hold either an RCU read lock or an SRCU read lock around .queue_rq() calls. The former is used if .queue_rq() does not block and the latter if .queue_rq() may block. * blk_mq_quiesce_queue() first calls blk_mq_stop_hw_queues() followed by synchronize_srcu() or synchronize_rcu(). The latter call waits for .queue_rq() invocations that started before blk_mq_quiesce_queue() was called. * The blk_mq_hctx_stopped() calls that control whether or not .queue_rq() will be called are called with the (S)RCU read lock held. This is necessary to avoid race conditions against blk_mq_quiesce_queue(). Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Sagi Grimberg Reviewed-by: Ming Lei --- block/Kconfig | 1 + block/blk-mq.c | 71 +++++++++++++++++++++++++++++++++++++++++++++----- include/linux/blk-mq.h | 3 +++ include/linux/blkdev.h | 1 + 4 files changed, 69 insertions(+), 7 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index 1d4d624..0562ef9 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -5,6 +5,7 @@ menuconfig BLOCK bool "Enable the block layer" if EXPERT default y select SBITMAP + select SRCU help Provide block layer support for the kernel. diff --git a/block/blk-mq.c b/block/blk-mq.c index 534128a..96015a9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -115,6 +115,33 @@ 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 + * @q: request queue. + * + * 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; + bool rcu = false; + + blk_mq_stop_hw_queues(q); + + queue_for_each_hw_ctx(q, hctx, i) { + if (hctx->flags & BLK_MQ_F_BLOCKING) + synchronize_srcu(&hctx->queue_rq_srcu); + else + rcu = true; + } + if (rcu) + synchronize_rcu(); +} +EXPORT_SYMBOL_GPL(blk_mq_quiesce_queue); + void blk_mq_wake_waiters(struct request_queue *q) { struct blk_mq_hw_ctx *hctx; @@ -768,7 +795,7 @@ static inline unsigned int queued_to_index(unsigned int queued) * of IO. In particular, we'd like FIFO behaviour on handling existing * items on the hctx->dispatch list. Ignore that for now. */ -static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) +static void blk_mq_process_rq_list(struct blk_mq_hw_ctx *hctx) { struct request_queue *q = hctx->queue; struct request *rq; @@ -780,9 +807,6 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) if (unlikely(blk_mq_hctx_stopped(hctx))) return; - WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && - cpu_online(hctx->next_cpu)); - hctx->run++; /* @@ -873,6 +897,24 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) } } +static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) +{ + int srcu_idx; + + WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && + cpu_online(hctx->next_cpu)); + + if (!(hctx->flags & BLK_MQ_F_BLOCKING)) { + rcu_read_lock(); + blk_mq_process_rq_list(hctx); + rcu_read_unlock(); + } else { + srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu); + blk_mq_process_rq_list(hctx); + srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx); + } +} + /* * It'd be great if the workqueue API had a way to pass * in a mask and had some smarts for more clever placement. @@ -1283,7 +1325,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; @@ -1326,7 +1368,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 */ @@ -1346,7 +1388,16 @@ 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; - blk_mq_try_issue_directly(data.hctx, old_rq, &cookie); + + if (!(data.hctx->flags & BLK_MQ_F_BLOCKING)) { + rcu_read_lock(); + blk_mq_try_issue_directly(data.hctx, old_rq, &cookie); + rcu_read_unlock(); + } else { + srcu_idx = srcu_read_lock(&data.hctx->queue_rq_srcu); + blk_mq_try_issue_directly(data.hctx, old_rq, &cookie); + srcu_read_unlock(&data.hctx->queue_rq_srcu, srcu_idx); + } goto done; } @@ -1625,6 +1676,9 @@ static void blk_mq_exit_hctx(struct request_queue *q, if (set->ops->exit_hctx) set->ops->exit_hctx(hctx, hctx_idx); + if (hctx->flags & BLK_MQ_F_BLOCKING) + cleanup_srcu_struct(&hctx->queue_rq_srcu); + blk_mq_remove_cpuhp(hctx); blk_free_flush_queue(hctx->fq); sbitmap_free(&hctx->ctx_map); @@ -1705,6 +1759,9 @@ static int blk_mq_init_hctx(struct request_queue *q, flush_start_tag + hctx_idx, node)) goto free_fq; + if (hctx->flags & BLK_MQ_F_BLOCKING) + 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 a85a20f..ed20ac7 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; @@ -35,6 +36,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);