From patchwork Wed Sep 28 23:57:55 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: 9355361 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 933A06077A for ; Wed, 28 Sep 2016 23:58:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82E9C2969B for ; Wed, 28 Sep 2016 23:58:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75C97296A3; Wed, 28 Sep 2016 23:58:08 +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=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 8DF2429651 for ; Wed, 28 Sep 2016 23:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753576AbcI1X6F (ORCPT ); Wed, 28 Sep 2016 19:58:05 -0400 Received: from mail-cys01nam02on0088.outbound.protection.outlook.com ([104.47.37.88]:38544 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752922AbcI1X6D (ORCPT ); Wed, 28 Sep 2016 19:58:03 -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=hii5XQved5BcP5LqPQdGeLy4avg7xSYOZuby6nkWh+k=; b=sB75DS5tB3pSeQdogwRVQ8zAAyNygNj8MTgcOuwVf6doZS9ZoA+HNUldfmFE6niC2FBlHuJk4vN3UV41L6UOeUs40LvmJglAF+gks5BZ94yBpZ5og25On6ER7DxWkzR4wiQpV/AHrmcLqiXW8/pgx5Af+so1KGPca8nNPOHAS+Y= Received: from BN1PR02CA0045.namprd02.prod.outlook.com (10.141.56.45) by BY2PR02MB2136.namprd02.prod.outlook.com (10.166.110.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 28 Sep 2016 23:58:00 +0000 Received: from BN1AFFO11FD051.protection.gbl (2a01:111:f400:7c10::187) by BN1PR02CA0045.outlook.office365.com (2a01:111:e400:2a::45) 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, 28 Sep 2016 23:58:01 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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 BN1AFFO11FD051.mail.protection.outlook.com (10.58.53.66) 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, 28 Sep 2016 23:57:59 +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 AA.7F.61581.8F65CE75; Wed, 28 Sep 2016 16:49:13 -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; Wed, 28 Sep 2016 16:57:57 -0700 X-AuditID: 0ac94371-5f3ff7000000f08d-86-57ec56f82ae2 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 0B.74.02783.4095CE75; Wed, 28 Sep 2016 16:57:57 -0700 (PDT) Subject: [PATCH v2 1/7] blk-mq: Introduce blk_mq_queue_stopped() To: Jens Axboe References: 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: <26c7db22-bac8-6d8c-ba6e-3cbf0cec3368@sandisk.com> Date: Wed, 28 Sep 2016 16:57:55 -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+NgFlrIIsWRmVeSWpSXmKPExsXCddJ5ke7PsDfhBhPus1v833OMzeLl+Q+s FitXH2WyWDUxz+Le0S9MFntvaVvMX/aU3eLZoV4Wi+7rO9gslh//x2TRtvErowO3x8Tmd+we i/e8ZPJ4cGgzi8fmJfUeu282sHl8fHqLxeP9vqtsHp83yQVwRHHZpKTmZJalFunbJXBlXHo0 la2gTaBixdvt7A2MZ3i7GDk5JARMJFo6G9i6GLk4hASWMkn0r2hnhHB2MEpM2juFDabqw9Vz UImljBJPr85gBUkICzhI3G/bwAxiiwjISnzf/RqsQUjATmLa/GawBmaBD8wSb3uPgiXYBIwk vr2fyQJi8wIVLXtyFsxmEVCVWDF9NzuILSoQIXHrYQdUjaDEyZlPgGwODk4Be4nrTzVATGYB TYn1u/RBKpgF5CW2v53DDLJKQuArq8S8ibfYIW5Q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dlEK7w2JEfMtnI21JnrRJLcUaioRZzUXEiAGMTG0YrAgAA 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)(3190300001)(189002)(199003)(65826007)(575784001)(86362001)(53416004)(81156014)(8936002)(87936001)(31686004)(92566002)(189998001)(33646002)(77096005)(83506001)(47776003)(97736004)(106466001)(2270400002)(229853001)(4001350100001)(110136003)(65956001)(65806001)(7846002)(2950100002)(356003)(23676002)(76176999)(230700001)(50986999)(54356999)(6916009)(7416002)(81166006)(626004)(31696002)(5660300001)(305945005)(68736007)(8676002)(586003)(11100500001)(64126003)(50466002)(36756003)(19580395003)(19580405001)(4326007)(2906002)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB2136; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD051; 1:J59Q1ggwaBqwfUu8uZlzWn562xzwUQVS6gc8HX1DBRly3AqMNYTFtLgtwKPSbclguXR1/b/SXHAvsLEwYXgC5N+0X9hzEm7kMDcLX0ithEBoBst29gM13omtfu1hYFuCgY7SuNj1Sjqvv/+2OBHoMISRgLuc4nxKSIMJ5Rtz8to/0RUWNp+868hehz5SAwCz6SXxFz5JTe870Z1nvybdqRV+4zlJNGBDv/UqNZd8XB58bfeIlyqV8m4ThxB81Muw3g6uVjDm0WX8ew2tBl34wesyqcXVLe/R0upoScXGbJUibkS0QVNNZYYGOVpwe3d7AIUrH0nd5SNCqxcra7sGRsYYVDulLug7ZklhaNkMA6fGfwd8hufKtMjnWjpI44s/l2yGMSyPcSA64a3vGDcKeftvEO+uGs2alXfQ6KNOGe04tAhiUXCyo2901X66Kn+rPhB6yvH5yjQ+yGo1V1osFJWLH4gHXvJwRKcBt6z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RbaRx6FAoBsPqtbBBibm6dD0qX9eaN6Wq0= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BY2PR02MB2136; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB2136; 31:695kAvS65gKK5y8IlYbGgdtXu/Faf+GXthowuY/msn9nHXUEZX8/v9LChJw4JqjBhaYzioWMaD0UaRKhKbTDjMFwANtK0mOJWcuXHPglv1GePxiYB+X5hfH1e7T0ROWpkHv0IUzVbQK9s0fEI1+NOFVBLxWIZ9wFddWTiWpB3L49ltdJ7AKg0ubCdgwIu+SABmmLG5rdUmd5EWqhPzqzaxSr1dTehaf6hF99E6LIWQg=; 20:XQNfBQSiLz0htj2ihCCN2z0WcO4V/HVuQuXtGOYB1N361ah5AXLT5C1MupGULrLNiZ0ZXK6OFlu+u5PKOPsCJLn5N3HwRqUZq5hDjQX4ruZHuij8UT/yxWe2TNCrf0kZno+iGfhAmUG+2xGWf3JSUVA6uZFOR6En2vLta4t8/NRj1+o45RnMGgZH2Ck8EfcicBRki/T304+NwhZB1Wo+JqkqXUlJ1WncjxE2/drkB5VccYUbCjTtRTB3tbRblIKryfVgRUQL2Hj9cqmbOlU+xPhC8SYYrs0dhiXEISt6JqSF8LEqKRx2BA7GC9CXKqMGaENsfIri1l8zZ6M6MT4RbGOsneBL/NM751VKi5ZqUhSvnnuUWfic07h2x2P3x8KevjtTJIKwNHmfDuDTmShIfzj4PYnE5n43zAUCRNMHUP0XMSNoo+/SR1Z/X6NdUOkMHAK/V5igsbrM60oiDfCkgRfvVBRS2CMQWP4ET2GIHnvcZGKmunjvP1Vma5fsqH01 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)(13018025)(13016025)(3002001)(10201501046)(6055026); SRVR:BY2PR02MB2136; BCL:0; PCL:0; RULEID:; SRVR:BY2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wXSWnkj8J/zTgCR12qn6MoGj5QwVSmzbYA13jol7/F2M9bYQVsO9GfItiCREzh5qWaHeROv/svXm4iBBEaqK5DEq+5nPgvilQKpmmYpiRpnytIUEQ==; 24:ookmYOsrJEN5I6oA5+Y6cyjazTFc8rjo9LC0DcfgctAfZFFZhfw+fhDaQdRSRlbGtJJVMs+puj5Wid0lbROdCeDhEK+9KVg6MWdb7lOOa1c=; 7:3AWzPbKUa6cfW8SVYZeEF9L2C0w/qnqzcZyhAP0XeYKI06QZvIzKkfqEFKas0aB5cCWYBHzjJnRHtLEEAare/4HewDpe7jVoGo3u66LFkeTeuIJXaBuVTUTL/Mpuedl39KA8TnugiHbG4IeZFZuH6N5JrvB5c+4nxvEd1VfOS4/2dHLOf04HQNzDn1kHVYz+UCaRs5sxJPa5Jca+EZZmQ6JC/77hedUTyFBy5znCraiSl4UI7UCa98/0bL1jONzbcx5lXTS9QavjW8rB0DVBPxOpNzyH4VuwXv+z4BW9U1cFobibTajXWzKP1sMgupcW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB2136; 20:R3SDt4IKqQa1eSXGdCEiXY4wsO0SvHByoCOgDf/P/hBrBb1NlTQB9lJrKDgy95SRExlco41C1hBucVUHZZODg+ebS1ogfY4GABluxBEP3ALqBd1wctr2zPXO/Zu1fUhc1xS3A8/YC4jIeoQITlP33mC3eTapRX+6ctqOZrzJyYn/wjbj7TbSHQ8bo9w0T3F0Rrn4+/s+CZB2QYgX2Kiv1+EskMCrDFf3Mnb1wxMQCP+OLZ7g0QiBto0u37q+wOJW X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 23:57:59.6544 (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: BY2PR02MB2136 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 The function blk_queue_stopped() allows to test whether or not a traditional request queue has been stopped. Introduce a helper function that allows block drivers to query easily whether or not one or more hardware contexts of a blk-mq queue have been stopped. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 20 ++++++++++++++++++++ include/linux/blk-mq.h | 1 + 2 files changed, 21 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index dc5f47f..d8c45de 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -950,6 +950,26 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async) } EXPORT_SYMBOL(blk_mq_run_hw_queues); +/** + * blk_mq_queue_stopped() - check whether one or more hctxs have been stopped + * @q: request queue. + * + * The caller is responsible for serializing this function against + * blk_mq_{start,stop}_hw_queue(). + */ +bool blk_mq_queue_stopped(struct request_queue *q) +{ + struct blk_mq_hw_ctx *hctx; + int i; + + queue_for_each_hw_ctx(q, hctx, i) + if (test_bit(BLK_MQ_S_STOPPED, &hctx->state)) + return true; + + return false; +} +EXPORT_SYMBOL(blk_mq_queue_stopped); + void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx) { cancel_work(&hctx->run_work); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 5daa0ef..368c460d 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -233,6 +233,7 @@ void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs void blk_mq_abort_requeue_list(struct request_queue *q); void blk_mq_complete_request(struct request *rq, int error); +bool blk_mq_queue_stopped(struct request_queue *q); void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx); void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx); void blk_mq_stop_hw_queues(struct request_queue *q);