From patchwork Sat Oct 29 00:19:15 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: 9402881 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 582A06022E for ; Sat, 29 Oct 2016 00:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 468AC2A8FA for ; Sat, 29 Oct 2016 00:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A3202A8FC; Sat, 29 Oct 2016 00:19:28 +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 E82532A8FA for ; Sat, 29 Oct 2016 00:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754985AbcJ2ATY (ORCPT ); Fri, 28 Oct 2016 20:19:24 -0400 Received: from mail-cys01nam02on0076.outbound.protection.outlook.com ([104.47.37.76]:41829 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753005AbcJ2ATW (ORCPT ); Fri, 28 Oct 2016 20:19:22 -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=S1BJc/l6TDYkiu8CzXUyjTM/VsBNUDpD4Aqd54nm0L4=; b=oKXlIcBiRgkbMKZHNpGTSOAFvXd0hnlFrYyCLVFYngv1eUMxL/bnjNEn7fgjOf+5KqHSzfxHv20q8JjreMK3O9jsy+0wOOmKtBDznYZIhAUCINKROBCOVNTXTJSsWxQaj6cALPXIo+i4mtYDNQH15HUMmPq83YsB5x6b6FSpQqM= Received: from BY2PR02CA0066.namprd02.prod.outlook.com (10.242.32.24) by CY1PR0201MB1578.namprd02.prod.outlook.com (10.163.140.13) 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:19:19 +0000 Received: from BY2FFO11FD044.protection.gbl (2a01:111:f400:7c0c::182) by BY2PR02CA0066.outlook.office365.com (2a01:111:e400:2c2a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16 via Frontend Transport; Sat, 29 Oct 2016 00:19:19 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.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 BY2FFO11FD044.mail.protection.outlook.com (10.1.14.229) 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:19:19 +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 4F.1F.26959.C68E3185; Fri, 28 Oct 2016 17:08:15 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Fri, 28 Oct 2016 17:19:15 -0700 X-AuditID: 0ac94369-b97ff7000001694f-e7-5813e86c8c73 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 9D.EF.02564.30BE3185; Fri, 28 Oct 2016 17:19:15 -0700 (PDT) Subject: [PATCH v5 02/14] blk-mq: Introduce blk_mq_hctx_stopped() 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: <075bab96-4f5f-d68c-843b-f2358319a0a6@sandisk.com> Date: Fri, 28 Oct 2016 17:19:15 -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+NgFtrHIsWRmVeSWpSXmKPExsXCddJ5kW7+C+EIg+kL9Cz+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi2WLnzJa7L2lbTF/2VN2i2eHelksuq/vYLM4/+EVk8Xy4/+YLGac X8xq0bbxK6PF+x/X2R34PV5PnsDoMbH5HbvHzll32T0W73nJ5PHg0GYWj81L6j1232xg8/j4 9BaLx/t9V9k8Pm+SC+CK4rJJSc3JLEst0rdL4Mq48OY8e8EnsYr53/8wNjBOEe5i5OSQEDCR 2HD8M0sX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3iz7xLULa8xPa3c5gnMPLNQtIyC0nZLCRlCxiZVzGK5WbmFOemZxYY GuoVJ+alZBZn6yXn525iBEcMZ+QOxqcTzQ8xMnFwSjUwqu9gnv5i6052794jERNmZ/J1txdo b/Jz7O6V2RcwzzxOo9nCpTqt/IiqgPbSXQ8Sp0g+OCtqxLGBwWjGr+dxThnX5282CD7G85lv 3/J9kVEtj1fsiVYyPaUXbfwsZH/EpkXFU6/wHnoyf5v04gf3NL7+mebwpqDzUfyWbxUBe87L O167r7vUVYmlOCPRUIu5qDgRADXJ8aBIAgAA 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)(189002)(199003)(8676002)(64126003)(81156014)(81166006)(2906002)(4326007)(586003)(23676002)(626004)(54356999)(50986999)(76176999)(47776003)(31686004)(53416004)(2270400002)(106466001)(92566002)(229853001)(36756003)(97736004)(7416002)(6916009)(77096005)(4001350100001)(65956001)(65806001)(68736007)(50466002)(2950100002)(86362001)(19580395003)(65826007)(31696002)(230700001)(87936001)(110136003)(356003)(83506001)(7846002)(189998001)(305945005)(8936002)(19580405001)(8666005)(33646002)(69596002)(5660300001)(11100500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1578; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD044; 1:naj5cbQpjlvukWjZArQ+GfrnvdtujF/o3fsjqEbgvRrNcyQVPWdSdTDbM7chA/wm+2KU/3FGw0wsqrt1aNi0KdLPoM4Ca+jAVl0pgx+Ox4j/1Isw6RWiFwg9Fl6iAaEku49AyoraOIfFulhyllr4fFCXjXlMZufMJGIRYqFlYpWmDNcZOtcWpjEolxSYsimYqnB+2PsSVP7hAgfX6llx5p5orPSJfG+DH3xy+7gkjZoaehTrawcTbCJnuuXgw8N8vE4k9PoB+zG+zvjfuRRoxhPHXB7jEFchbpTvOSY+34l5b0sdlL940jQLaqshbxfKXm0DfHvGoTcN7c/3GkPEytXaav/mTyq70ZXPNRzi4Nia3tgD9hgnr9oKTU2nInOw+sSrlteJ+B7f9Fb8PpNY5kBb4QKk1slQcGeOEVB0nHTH1buUsw8Im5bwERk1dOUJ0wS5l55c6onuiszgJOJ2JOQceFbWUuvlpLkY912cnsXJone0/QHDwXuRAo/1tNhK94Ayo09VCa9JmCwPX6BM9sONl/F/aVOsn2HookgMOU5WVjiyroRA1UmPffXJiJ/6 X-MS-Office365-Filtering-Correlation-Id: 5f7fa160-3d8b-43ed-bc6f-08d3ff9139bc X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 2:lROLtLqu+kcgGo7ouKJQ5myaWuhFSk+vz7Ne6I7iO/0Ok8QCiW3JjRFhEiWVHY+evs+JsQHj3oPOElsiN68BHX7tyTdyPjlBaz281VJOlxcKp7KHeLzsWh5Bo9VZw2KDKMIpcR+VPMIDlU6yuNJXhqbaRwsV1tU6THN1bpBHiOAdz17ODcWCmvMGOvcOiLBczs3w/LlpxUVY2jO+WDl98Q==; 3:40OwiqpWjO3Z5LaFwotRn0e16H5QRyKNmt+K01FUzGNkUEN1qnkmzLdR4F/ZZQnmfon8a10mHjeLxIR86FAsxjBa3mVLo0fEIvtcQn3934UY0/e9w9xzGclUFwpf3sPOPkLdYKLCuavslHN+v0Tcrn7joMh1kRVhfz1Nh+PawjsbkGl1KJ1xdMI9TOc61A+PZ20Wmim14M+40kulwHk5yLPtM7gg+kXdeueBsRc7+uVgyR3FZtHl8v19Hpnb5x9pSctemDMI+5jrIqV9VDW/1CA9f+wvfny9ilTNtdpQ6lA= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1PR0201MB1578; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 25:zT198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3+vYW5GyZk; 20:V1CLG4P/wvZ/DVn2erHurlWalPMeMkGgUxm4EhZZ93AAjI3+awwVtOvuONjnS6F0RDkmgRY60Gj/0U6Aqli+GabBVVcdp5HN7ihg+jAwfUKADKxXdwrmKiJdXhORpOuIN4H/Qm81KsfTUDaA4pwtzGh3g7rc5XK/HnU1LxRQ2L5SsegtpCQ1rQin0ee7A5P+x0izxj3pejqv79hrJcSdvh4tdY07RnRsuATziR/DdfMA4LCCPqXBc0pyMLc9q1gmt43fNu781fEZxMKAKuWq2tvlOvkqVC4DSXsshorNN3ldp25mrBixN6WqsIywy9/+mPbZZa3vhZItSd2y0Xqz3x+gdoM+I0E//20d7USOiuRA0gCI1tet73+1USyyf5tlXn5BWihNtk/59cbSytPpv2mwMz+LWgozCanLpoiDbp/7Z1zcoUEOwk1ZfProbt5KYDdqbm0nBRTQc3DEEWeHQ8CxI58flX1fniBthWLn12MVApqrzveoWOE7lxCfdh4q 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)(13016025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0201MB1578; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1578; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 4:zsHOTx3BDPHT986SZOQSbzKrx1OigF9m+ZOnUNKeIF+1fTQJLn+BmG40wbO+tmsx8/cCZik2ON0EX0HxF7/W57cz2V/iJ4WQXGTWI8LMj97VHIf2v9oBjLD9lKI5HMhEgL6haWK1ZL0/9u/DkMpOYif3yZtMVH5YRwYTMQB421u68D0Uv+0d83VjlHDy6sFu2FVEZ+EJWU4NhlECERWMgLVdUWVHcwd8PLWi1bq2y4lLyt6Vu3qiHCeDaUjotWFHKNaXCwJ9AFO+yRJLeacr0OXyz5xF7gWFMKV+d1yK7aNcxT4vIiaRbs6/hnXvS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S3pzZDh1bDVjczJkN0NwaXl3cVFMMFJLYjJxTHViMlNncVlBYmVtZXNoSWh1?= =?utf-8?B?bGtrWXIzK3VwdXhwa1ArUFNBMXE2TElxSTlSNmpLeXNmczZPdUc3YXF3cUlC?= =?utf-8?B?eHNOMlZFa3JNdVdpK0FERkE2eWovSEpzbkgxOXNmQnZBVTNwaFRVeEViTjVq?= =?utf-8?Q?80c8gL5fD+kkRwo4/GKwxCUxM9BK3u9L0SqWgpM=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 6:6Vk6KCHEgbCUfZoNDx5Q1mfbvSJsAmvEXR7w1Jkj8mMWQJvRWxe0yIQP7iOZnrCxpJq5IXVaJqai18N7jjgPLGhx+AD9UycWkI9oAvwLEA0H1oyCG/9scssbl5YlTS8a/SN7Pqk4DkeYP+JEsoyEgMd5ZxFqxq+CqFH0+L4Bomd9h3po767UNNsu19h2Os2IFswiYj+72WFZW7u9erjWbhw8JyzekhgWZI7VDmHgRBLAhWtRwjCFqdC987F0jFrvuFx4Qz7qU0irIMU5Ffhc29ftgOqVednd3X7OC1LCm/uh0lr4xK93rncugqw8QBqGthGpsmMu3TM0Nxf/c7id5w==; 5:gICLEfbTZXqrgu85muUwpkn+M9mPAwbsKGaZrnOff6DXfURTNPXGUHAeReZrzfNd4GTT0E9XahCyPtFieOiiu3QdZVbz9VZpXNdFs9EGefYuiqu/bChlS3h1pNcf13vaY1rYuKckP4Ou8lptL6eY/A==; 24:AZBpG+b9ovv16RHcKZ4WYH3Z1scmVXG7mL6L8CICzlp8bPhB/HiojLU7F5sLnD87wp6syn6hyjtWU7MgkzTW5RDRmpqPe2FMch4wnUSx5n4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 7:m6uUgftUVFC9ZQyw/E8sNNpCUlASz+LPse/H9tO6Z5bGO93u3vWZnniuGrN1wObTa4tsmVhrTSb5IiMIdYavuLVMhIx5VRlJTOxLInmdncwogFS1qz+eHuM30nZJuhpcqkbx5MIr8XRVnjOntHLBrDRE6ymt7RoTSGiveSjZpUX8GtA/KCntsrFbe4dmDyL/xaUAoz/yKk+Mfz/cbZ3+CfTYtuH2OYf2jq2COkgzqk2VLvAqx6gPGhGxQOADb9LYNkoaLF1aqHm1X5yOKX2x3xulIfQ2qk+Qjchw4vu4XuTyn5P8NoP8Jj8Ij+pgifCkrD7Dyp0LyPIsKrwV8fIeYANrQiVhHqganbXeh2BtTIw=; 20:4llicCidojBGxsi1CRydZDjq5pfu+zU4e8Gckj9j+9F8LA0OEMBFB6h29HWqyXmPH0/IiLv/mpIE0ahzGkfM2k56uo6Y4lGAdYKxqjoX0Hh3FoKWoqHqJS4YiUM5ZzjZNkEWqXzw0V8i6zqr22f5EdGL7fBLMm/GYgMRr0D6wcQS7Vw40ApNuwIdHn0d4qYSt60nFN4F14LtTlDppwpp7jaE3e7APLxwvXm+nTW4e8Gllq2xAEBIYlTNIxDWlz17 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2016 00:19:19.1979 (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: CY1PR0201MB1578 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 Multiple functions test the BLK_MQ_S_STOPPED bit so introduce a helper function that performs this test. Signed-off-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 12 ++++++------ block/blk-mq.h | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index ad459e4..bc1f462 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -787,7 +787,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) struct list_head *dptr; int queued; - if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state))) + if (unlikely(blk_mq_hctx_stopped(hctx))) return; WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && @@ -912,8 +912,8 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx) void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) { - if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state) || - !blk_mq_hw_queue_mapped(hctx))) + if (unlikely(blk_mq_hctx_stopped(hctx) || + !blk_mq_hw_queue_mapped(hctx))) return; if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { @@ -938,7 +938,7 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async) queue_for_each_hw_ctx(q, hctx, i) { if ((!blk_mq_hctx_has_pending(hctx) && list_empty_careful(&hctx->dispatch)) || - test_bit(BLK_MQ_S_STOPPED, &hctx->state)) + blk_mq_hctx_stopped(hctx)) continue; blk_mq_run_hw_queue(hctx, async); @@ -988,7 +988,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async) int i; queue_for_each_hw_ctx(q, hctx, i) { - if (!test_bit(BLK_MQ_S_STOPPED, &hctx->state)) + if (!blk_mq_hctx_stopped(hctx)) continue; clear_bit(BLK_MQ_S_STOPPED, &hctx->state); @@ -1332,7 +1332,7 @@ 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 (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) || + if (blk_mq_hctx_stopped(data.hctx) || blk_mq_direct_issue_request(old_rq, &cookie) != 0) blk_mq_insert_request(old_rq, false, true, true); goto done; diff --git a/block/blk-mq.h b/block/blk-mq.h index e5d2524..ac772da 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -100,6 +100,11 @@ static inline void blk_mq_set_alloc_data(struct blk_mq_alloc_data *data, data->hctx = hctx; } +static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx) +{ + return test_bit(BLK_MQ_S_STOPPED, &hctx->state); +} + static inline bool blk_mq_hw_queue_mapped(struct blk_mq_hw_ctx *hctx) { return hctx->nr_ctx && hctx->tags;