From patchwork Mon Sep 26 18:26:26 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: 9351127 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 C2699607D6 for ; Mon, 26 Sep 2016 18:26:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B62BC28805 for ; Mon, 26 Sep 2016 18:26:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA49E28A17; Mon, 26 Sep 2016 18:26:50 +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 3454328805 for ; Mon, 26 Sep 2016 18:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941387AbcIZS0s (ORCPT ); Mon, 26 Sep 2016 14:26:48 -0400 Received: from mail-cys01nam02on0054.outbound.protection.outlook.com ([104.47.37.54]:44480 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934150AbcIZS0q (ORCPT ); Mon, 26 Sep 2016 14:26:46 -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=PhAK3hPkw63NTnEd24pb7FiKTyhlpHvGhdJFtJb1yvQ=; b=JUe9a+pQ3f/jig0WjW5DiGr7Ad6Ru8Iz7CSQjVcWsQUWr5RTPUWuyyMYDhc65eTypZ2ugs076lQ2DnPUEkZHz4PWGvnc1ZDKFdxdKdkBGMkWCYihNf+LRAmNCIfbClMN3HaNrStlq9TzunO7v6bZ/yEGN0vW/35/FsB4bA84tME= Received: from BY2PR02CA0077.namprd02.prod.outlook.com (10.242.32.35) by BL2PR02MB2130.namprd02.prod.outlook.com (10.167.97.16) 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:26:43 +0000 Received: from BL2FFO11OLC010.protection.gbl (2a01:111:f400:7c09::121) by BY2PR02CA0077.outlook.office365.com (2a01:111:e400:2c2a::35) 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:26:37 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 BL2FFO11OLC010.mail.protection.outlook.com (10.173.160.154) 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:26:32 +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 53.CD.61581.F4669E75; Mon, 26 Sep 2016 11:17:52 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.301.0; Mon, 26 Sep 2016 11:26:29 -0700 X-AuditID: 0ac94371-952c29800000f08d-d8-57e9664f2627 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 3B.BF.03606.25869E75; Mon, 26 Sep 2016 11:26:29 -0700 (PDT) Subject: [PATCH 1/9] blk-mq: Introduce blk_mq_queue_stopped() 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:26:26 -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+NgFprPIsWRmVeSWpSXmKPExsXCddJ5kW5A2stwg75+OYv/e46xWbw8/4HV YuXqo0wWqybmWdw7+oXJYu8tbYv5y56yWzw71Mti0X19B5vF8uP/mCzaNn5ldOD2mNj8jt1j 8Z6XTB4PDm1m8di8pN5j980GNo+PT2+xeLzfd5XN4/MmuQCOKC6blNSczLLUIn27BK6MqxNO MhYc5K84cGIWYwNjD28XIyeHhICJxNO7k9hAbCGBpUwSU654Q9g7GCXOLIyAqdm/7hdjFyMX SA2jxJM7FxhBEsICthKLJkxlArFFBGQlvu9+DTXITmLW7DY2kAZmgQ/MEm97j4Il2ASMJL69 n8kCYvMCFa0884EZxGYRUJW4vf8LO4gtKhAhcethB1SNoMTJmU/AbE4Be4nXd38B1XMADdWU WL9L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/n6+s zHBWs5mW7inBpPpTRl51wqJzPUIcvecZ65VYijMSDbWYi4oTARame50sAgAA 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)(575784001)(4326007)(86362001)(92566002)(81166006)(19580405001)(77096005)(65826007)(65956001)(2906002)(65806001)(47776003)(50466002)(8676002)(81156014)(19580395003)(586003)(6916009)(2950100002)(31696002)(7416002)(7846002)(305945005)(626004)(33646002)(87936001)(64126003)(83506001)(5660300001)(11100500001)(8936002)(69596002)(2270400002)(229853001)(76176999)(4001350100001)(50986999)(53416004)(97736004)(106466001)(31686004)(68736007)(110136003)(54356999)(23676002)(189998001)(356003)(36756003)(230700001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB2130; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC010; 1:5LqQpGD/s2JvdTYU4IA9f+DLVogM2c0oWlsFFA9qbO9Iexn8v3gdn4wA30YSpfmtKQYFgr9HldR5lEsTbXDJdG83NUtS6yy1xak9cEHfLfId2EtzxmtKukSenKjL9kptF0IwFp3++A00+JdYPjxde1iaL04/D5x962UKoM/H/N92/GGdtJ6MGisJhqzGJlLm93FWm/UyHNd7I6QwTf5Wy87yEjNa5QLbs30pCFUm9LjnEBIjiPJz6aCHhO58ZCzydHtN1M0C/DEgFlKi9kSfZsWJl6pdRK9TwVY7851IOmQ7c8TQ35T8WliX7tjHQJGjlDFIELlR3ZxymtmWXZNLuYZaLFbl7m9xnjaHYLSgJ3hJJS8CgQ6dejJ6q5meGoimf3VYnyUge5S6H/UnUYqei/bA6bjkLhIdhlz2AuEcWe4sWj0KTQDoQlQvlnpHp10+N8gbIiFrwxasgV7qqbVKKas4zzJ8wZlkuCT4ib0uEgOG4DmJc7/xe6jBDpUUMCQastkmldbJ6KS95CxAdK3uA1lpiLMY5hUoHgCw3XnTuorVvKneQtbZV6nr5FA9Uz9L X-MS-Office365-Filtering-Correlation-Id: 57c2e276-abe3-4b4e-a198-08d3e63aa6b8 X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2130; 2:fqUMEmPMr50VrpPtFxNsp6eu51X4qND2zNu35Z7LSIrRMJYcS+kwSMnu3HynYD04NSeDtCoIRD4HlK2LWQgGpGUNs/+wdx135G+6riYO+W50woMB0BdCwRfo7l8mQxug4Tb44mQSfvIwIovj/c0ofhRNjw0V3E/vL7aLhgmbaXX88rfsX+TEaBqDOSrNmvx3; 3:QtmujYku9GGSRiqT88/SyfWcR5bX4qN+rUSB8Jywgf3PUuF90kx8Xq4XrLAkostYGTA21lHqSOY9w7sjVh5YtIvAEGtm1k9NNyrIlPnct4bAFacJdtqrbQryaPKw46d+zBfN4ve9b/ymitdsEA1Ey/fMiGSZ5Jpqke4lAGjoozFuEuWINpBaP56R/QNmaRVBx0Yno2JOU87Tod0nB0qCeljuaeSQSRUPRyXKzphk8BGTIDaq1UCz6XGob4+MjHQ5Zhz8OGFTX/Cpn7d0YZBfwQ==; 25:JB6afWVwOOvYNL69xmD32r11LZSd2ACj0nu3yuG8wRoeEVjVnNxCcEh6E3/ztF0mUu7HReG7py74ABeMYIafXBvY8FRGbajqnO1inknp9fWxXhW1oebCd/UeZ2sMYAVg0bkxe4oA89XilNXw3RULBApsLiDe95beWcghhFyudl/s3/VaMwvuEmW0v7ai9WjDepCv54OH8dRTw8P5QASufmx0ykRgs1jFsc3+q1XOq2RUllZHpv1K5Ehxf70hvBohyonZ03PW9wogWmAWT4hAS+dcRVFHBHsHVyD/oS0dyowuKHRsbE5gfYkX4ws0o+fa1NpRrx1uZ244fq1tCTKT6FdFFuA4vmuBIhyoAbG1qeDR0rRiE5gxDe43dm6QDaQINfD6zrEYynmaiv1gzYZywr6MB5P5cTiCqc4nV1trkME= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BL2PR02MB2130; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2130; 31:czQ6uWDtNbbIvX6DehXKex1kk3gZ4aGU5LJalMYKH2gxqhFPl5rEuHm74isMhfHTim8laAHh91oXJiNDB2Dp2ECgmFtTkyM5wMjgEfs4XJqYxu1Xl8Dcd53zmvhTBc9mRwXPbvHkNqm0T1hLa76Jt1cziHTX3ONx5XoTG4pieFGggh5xTl/ZN8S3eFruflk6bONZC84Zq/mVoZ7i0XmUzZ5f8s/UI85ZRIiRloNKgw4=; 20:Llya6RsQ/cZuGexkuVsH0EcojU0PgEY636KKhIg+ujXgjp/RrXpzGyiVndZwl6DxOqSQJeZwXje/OgyaP1keMT9JrCmxV2X21TU0xUwjIw3DvKW5mQxo8+1b1H4wL1T0Yj4p1ov/W8rDwmkf0VrQOywDD4O9kxdNIKdPFkpIequp9DMBUVAxk+8Oe/I3mg8mYZS8SsvX4s2MVy1ZlOncgcRXQ+ZcILFEtzmo+czzBofisw3kQOuj/Nkhp/ctfwEvp2QoLWtNra583ccVLNlyIExnHSCJJOVE+9Pl0oaiOrG3+nuyE8pYFpON4OFpNvjWQC5q8Q/HdP1L/5k/i8qA6kwrH1mpiZFKgNHJjwwAg8jxRLVyzJbmGlIM3BI37nTw013oqrzrqBlKHrr9PK6NEL2oZIIet0NnHJYoxqwgpkL8G/hBhaY2HelA0n13bb0jaKSuSu3ux+1oQE+eSJDsszlKhemLDt3Nl4Cw1Xd6BEHYr1Pr8oYTbpVksxbvxH/e X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(10201501046)(3002001)(6055026); SRVR:BL2PR02MB2130; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02MB2130; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2130; 4:ZZTEu8+aoCf9IZSta71ZP3k9zBmp59GgkLmARjbiGu4IzynnxQ/HKTPabrLeDic/ct1r1kAZ73K/HK45qlcaF2fzs6SzsJI+DWIsEP0jI5Hc94kZNCOwN9plHCKltH7xziGyBP6Jeqy+3vzlBim1W8dRGoV9d44/OWTEOccn9e7/WMbnA5+Rb2JK12KDPyLk3cfwxADV+3OgvkXNl+BKTDrxfAkGiNTglliMh//B18E4c9C2sINqwTyhj/7j5T8b9YdrgAhHNj8go6DB3lCFfDGC9mYbaukXPktxkVQHJyNfxSVqbFoOagNexsCbGAcwq86vFNnggfNpsJF1IQaLycoatxoa03yx1nGThz1keNkygES/NWx81t+KSO5BSe13cxFqfpzg8N3/qBzK5xEyEBoBjiLEXjHptSRbDJCQX0yZNnYJvKi8qoY6sw6zGo99fJDeHU9SJ+oErNGb+dIffYo1yGShdEln6klHDgKThi0WHZQS29zgwbVB4Om+VVmLf4kAHfcQcZ8QI3XnzQHBeQ== X-Forefront-PRVS: 00770C4423 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTDJQUjAyTUIyMTMwOzIzOmRrODN4cWhaSEhVTE1LK3N1OXNpczRoV2Vm?= =?utf-8?B?KzRoRTBuOTlyYzh4NEVUbEhVQXNwalNWdjRYUllTL1VpYnFRU1dnTFZEM0Z5?= =?utf-8?B?UkFMczlUQ1VvK09MbzA2UVlqKzFaeXFjSkRFS1FvdFovUHJxMjJ3ZGM3Y2dP?= =?utf-8?B?LzZvL3ZRWjRqNm9Ybmk2THZjWXg4akkrU1NCQnlra3FLMVRENlNXdTQrMkI1?= =?utf-8?B?TUMwcXFYc0I4RnNHbnFMbU8xZnJwWjlCMHVzOHRGUmVURWp6SGJXZUNXZUxj?= =?utf-8?B?cHZpMHgzQU9QMUhRclROdjhwTzZSVEFHME55OXlUV21GdEM4dEtzZFRTeTJn?= =?utf-8?B?bVltLzBSUFl5amgvSmNTM0VDVCt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Z3llXOFXVMcmRQ29dE4xjcdOVLwbOtvorkGfGwr7ItVUjTLVNd1Q==; 24:f7bGY+XEP09oN6kxrx6VlieNL04JK2tA9UvpQEz3NH+YQ8tcz3+0g5KM/G6Ftb5EwEwHYsbUTT/7s3JaKQDA4l0Pg3rfAS3pN15wOoHZdjM=; 7:huciExyUKMqxA27+MGJX8PCg+xiB9WlxlXx7iUGuHeJjKgh/Nr7OOUwc5kuImFyXfzolUB1sW7Rpd1HhXScOuTL9lHQWpLcYvaAj/wCSHcrGPo6yeqoR+6jHdJnXYtHOCo51bpX16PYzzYYxLhiJbdyCvV94uo2P2/QN+1ILKXuFzJbAqGVakTd6Dw3PJMNOMMWImyrquWTwzKJbEZiT1H0u34NxVLH2qb5HewkIUr7erTBGz3/3DDELO4rDxAJLD2fDJstqX9+yrZ432jJSFfFuohnKVn2sbuJyhXI0oYUzD3lb2ODXD7ejYyllY+zx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2130; 20:jghe8SwLUYX5IO5Mqs5TkrFrIael/a05IEWOGD/18reONpCaKV5rlwbBZXDW+lbW6/B6eYtoQ2HQe0rJfe0w58oVuy0fGpuNLfWK75Y+NEkG8ILxp0TN+Km47wG7vgdoIZAWlgXrYvD2c4pdCUjXeddTet0SIaLtYwhixUZJ2R42bxncxcpyG/joehI0nMFAd718pBXtHWVuz4MgQ1EH4NiB/Iz78kD7ZFmMTFt6xGF3juBqMhdHDhQ+itTMObDj X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 18:26:32.1246 (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: BL2PR02MB2130 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 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 Cc: Jens Axboe Cc: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- 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 e9ebe98..98d4812 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -938,6 +938,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);