From patchwork Wed Oct 26 22:52:05 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: 9398569 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 6377A60477 for ; Wed, 26 Oct 2016 22:52:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BD6A29E21 for ; Wed, 26 Oct 2016 22:52:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2092429E26; Wed, 26 Oct 2016 22:52:36 +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 A266E29E26 for ; Wed, 26 Oct 2016 22:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932758AbcJZWwd (ORCPT ); Wed, 26 Oct 2016 18:52:33 -0400 Received: from mail-dm3nam03on0076.outbound.protection.outlook.com ([104.47.41.76]:13838 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932584AbcJZWw2 (ORCPT ); Wed, 26 Oct 2016 18:52:28 -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=CawDZFjLKijDP+NkF479sF2+Ad2cR7+EMz9bvoASowo=; b=v+kh50Kv12tl8GpV4xvs/B/Qj54rtlmKl4SStvEF8HPUCEXAiJkg8DbkMML6ssKIYlCHSIoO/F2/mro2/5cIk0ppESVIRt8T2cqGJWmz8cgoiWuVhVkDNxKVqCUZdnZnfRBP6YHdvNwHNnXGANsZs2zi9QQyovbRrTapPOkHLxg= Received: from DM5PR02CA0053.namprd02.prod.outlook.com (10.168.192.15) by SN1PR0201MB1583.namprd02.prod.outlook.com (10.163.130.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Wed, 26 Oct 2016 22:52:23 +0000 Received: from BY2FFO11OLC011.protection.gbl (2a01:111:f400:7c0c::195) by DM5PR02CA0053.outlook.office365.com (2603:10b6:3:39::15) 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; Wed, 26 Oct 2016 22:52:17 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 BY2FFO11OLC011.mail.protection.outlook.com (10.1.15.22) 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; Wed, 26 Oct 2016 22:52:17 +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 C2.BC.61581.F4131185; Wed, 26 Oct 2016 15:42:23 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 26 Oct 2016 15:52:05 -0700 X-AuditID: 0ac94371-952c29800000f08d-e9-5811314f6a7a Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id E2.C8.03615.59331185; Wed, 26 Oct 2016 15:52:05 -0700 (PDT) Subject: [PATCH 03/12] 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 , Ming Lei , 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: Date: Wed, 26 Oct 2016 15:52:05 -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: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsXCddJ5ka6/oWCEwZHPxhb/9xxjs3h5/gOr xcrVR5ksVk3Ms7h39AuTxd5b2hbzlz1lt3h2qJfFovv6DjaL8x9eMVksP/6PyaJt41dGi/c/ rrM78HpMbH7H7rFz1l12j8V7XjJ5PDi0mcVj85J6j903G9g8Pj69xeLxft9VNo/Pm+QCOKO4 bFJSczLLUov07RK4MqacbWUtWCdQsXJBQgPjB94uRk4OCQETib2vupi7GLk4hASWMkksm3Wb HcLZxiix7k0jM0zV5sf3WKGqGCVOPTkNlhAWsJf4eewaC4gtIiAr8X33azYQW0jATuLnmfVg k5gF9rBI/HuwFKyITcBI4tv7mWA2L1DR+2/TmEBsFgFViX9fboPFRQUiJDZ9nQNVIyhxcuYT MJsTaNmar9OBruAAGqopsX6XPkiYWUBeYvvbOWAvSAj0sEl8e3CcEeIIdYmTS+Yz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wx6piFAp4lViKMxINtZiLihMB1X1Y zToCAAA= 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)(97736004)(65806001)(65956001)(6916009)(65826007)(110136003)(4001350100001)(87936001)(2270400002)(19580395003)(626004)(47776003)(19580405001)(69596002)(230700001)(83506001)(2950100002)(23676002)(50466002)(31686004)(50986999)(31696002)(86362001)(92566002)(81166006)(8676002)(356003)(54356999)(2906002)(106466001)(76176999)(81156014)(7846002)(36756003)(8936002)(5660300001)(229853001)(189998001)(64126003)(11100500001)(305945005)(77096005)(4326007)(586003)(7416002)(33646002)(53416004)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0201MB1583; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC011; 1:uEwSjxom8UogZR8kfzcNTKrsZp3dszRA48AUxcje13zk5iJdXzJXpVVVrpw8zoDKoKFIqPlLYmp8hO2drTRb6bNyxcW1kBnrSQ91rqMiaw8JkN6FuH8yW0qlxvk0NB6F+dGFdPMH9BbyuQ0/2TfHEk8qM4hkhN81SyvCpXYYN//c7epDQzWgkLqPi1Lxfkjx6SgLdzjn9iwz3PFRYIzQhkXpxhN67Ih8e1DIUNbN71MW6olZIiu0OZ/84upA2Ldbl+Ie4e8uePcjx8wvi3tXaFXE2RN9WjBfew2IYTfi5fOhri6PMsUb30TKyoWVPCenCz5kHdkMJE+p7b4gdo3k5B1pZH0tPCkl/rnnI9a1WVK6oEBmYxI9J7/z8iTGRUhMkNq1lGs1hPvoR7WVFXLGw44m0JwWWgL8WE12rnGH1NEG0r9ytlkfDKPSMDsbRDurOKoFIBTWTfdRAo4Q01LMhHztIYsc4dLmI+0tTB6+SOzcro65f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DmS2MPeVepQubkJHs3wNtqOqXlT3TU7nVruyOYRM1Hdf xwC/BR+M4OVr2XJbqxgNwPqL0Kutqpqxu7n X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:SN1PR0201MB1583; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1583; 31:4UwhegXRvi27hRHF/c14y3z03U9e3Xtw3gwR3YWC8/uhz7ITpBKZfCPZKCItG2ulz6gxrckGRad3TQVnYt878l6hHzyewRX97lJH7cPyDzlcHQeBXk8kq4jnDK2PXvMmN2mJerqNJNrLlokttqGIv0kIV+IInhIcpR4FgfmenMMhW/N6hlR8GcIZ1JdFWowDDON6Jtc7BtGWoZfvsHqFIJAa3VdVLzYW6WORO0HytGPUlghredwJjei8OtY56yWyqR1s37vEGag4eNffYDVqYQ==; 20:p84qhMXXq6jikzFQ9HjdrYkFJDXLtnNDIhBFNVbJlkUmMpYORb+GMiEPdZB0iLNzAJv1AMu22nw23+CWslXa4WG3nMnuUmTVgsMtOn6YyZxElsAGlcbOT7uD1ijmLKbcbFoRSkRFbcPVM1RgZRKWgb2HVTFouxKUqC8rJmuQMJ9s4utpxVKnatP9zAAZi4XqkQ4rn5E6J1crgNPE6MaSnt5NVC0GMZ6MtsUNPVPMJsFQZATpcpviRgFH0r7xhAv+xSFA1Kfrtwtd04vSRzVqGTFzf0YcrAKllwRHiifBeYXyMVWmvy+2OJgE/iHY9jbWnYCK6pHdM8UfB5E+VosB1fVs0sOhvWAAwoqCGFJobWA4FU7WQfaKUKemh0LYtjo935UeKWIQdv7G7xLg98mY8zU0fadgDKhzbjSCVkyOEXupE0POkHF0dNV6QhtQjserH3KmIlO8GOvbkMVaBYkjxRntnt1F3kL617VDbV6egl3NHnziL67YkXmCrnj17BBY 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:SN1PR0201MB1583; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0201MB1583; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1583; 4:C8WYqo0mD5K3JM9bufDSCPF9QnfRVdRoWcRHBwNuT8qI4yCTmOZyss+SaPFap+o8OTf6MZ5Lv4Id2alZVifs1CQpDDzlv+joWL9HqWWbvi+KkXAEq6JHLsyO+zRTjEHeM+FgJO3SLdgKPt/jFIsWe0oGk7njct8Ik1KE9LQw7ymd420iHBsLnsdq1nzbYliUME3P/hyfidd7bEub69ijK3h2L/W2fk2fhoTAt9OFuP0bG66MXmc0zyUl0Xh7mpbhvUhr3gwvcp9R+e1ca/v2smKPyTj3v1/7TyGC3n93Mags0QRfQYHM5UtooW0tWKbJ116ZadXlbFyZ85oiW4UvaPUdhgpnfQY8EbYMbtKIoLI33ocUTc7ajvQ3C1vkvLuDDr6l7A07tzrIgfcGHcOq6/ldq3On3HaB6koOV3qS54xI4UPUVz3jf7P0NVjtIjQ7RSFOlvrTvxnLva63u4Fw6yxei5BhpIiLpnwDUXALICqInmiqXLGK8KjgZpg71aGC X-Forefront-PRVS: 0107098B6C X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjAyMDFNQjE1ODM7MjM6TkFsK0ZpYWhMQms0ZXdPUEYxakRyRUE2?= =?utf-8?B?UzJScUNzcHExVUJoV1dZWTBZUWZLQU1RYzVUTURna1phK2xxbUovUXRtRjJX?= =?utf-8?B?ODNjalRGSWtUeEgyQUxDWDkyRTRYazlwaHc3bmNhK1JIckhnT3ZjU0I1YlZZ?= =?utf-8?B?NDFnMXFCUGNUNFRKK21TaXI0MGp0TnV2Q3NOV0ZaZm1NWWRLcklaK01iR2ly?= =?utf-8?B?cU5LNXNxQXo1ZDZuVjdlR0s5Qm8vMWEzbTR6SmNOVTdSc0gyaktuOUYrRTR5?= =?utf-8?B?SlNtZG1TdXdCcWczd2xrZnV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JlF6nvku4=; 5:2m2e5v4FOIHfO3/9ddSUXMumaJCG17c9t14GDWrODMuSutUIMtqLoHOEv+orgvcR7GaCzOyrEOpiN2rGXn7LBwm/9eH7T1LwilcEoW8tV958tMcSu8+jj/UlKLLfDCgNeRcSpqe7Oe3qsxR6qxzs5w==; 24:4RpkCK9q/FZDi1pLUb42tp49EDMMyZNyuwIHs9FzcK7/GzcCJ0KLGwaKMQsT4V5VNMVh+Jfo0fX7IrgpQEoWyX6LSpAeyJpcYrB41FxB8is= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1583; 7:fbi9b7lj6V9MxrO/KP0tSYlTDySXFLCWfz7+obXC2Z0rwhCNEhU1kzbShvHcz6IVXQnJR1/FEdWhqD6/wP3/Bf/dreUB1aG8bBBXJbkCklkEXd3PzzsbrBs3o9p+1Z+nVQyHgt1QZ6MpOTbYjW/1gjDhvElkZYteEUUXB9RbYk9IV5VnbPg+qJ/78NCRL5xy3tMSmNer1CPCvpoAUfe4rEGDsdCh21/LoUfi35u38K6ZfnNAeLI7IXpgicyYQoMRJARBaNnV+ERLNQsaEX+GC5LVO2lk/zSaLd1zXqWuWbFDK0OwVKPt4Wp66CLkHrKAUB2g5FKWeqgwSddU+G59LmsfCJf6uTHAA9sjzjMcgFg=; 20:swkMvqnRDVzwW4TjZ7A8TCe7uIAH7TnJmWQm8KLftFsbuMLSqYa09LsrYNfNNzn56y5+pX7XVckTVEKQb23uyiqU7wmPlChepjWCd85KVPE74UJIaokNfhkSnVHJCv0uj9HnTsjCej/z04XcUy0g8/V3SJxts2mMtXRMV7dyGBfP3tWczF7xaUDO1jRr6/WfJspr129AZe/k8cSWtUJi2uyliBU+MMXldp6YNPUr0W9uW9SvhWU0TtA9RqqjYIA4 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2016 22:52:17.4188 (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: SN1PR0201MB1583 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 Reviewed-by: Sagi Grimberg Reviewed-by: 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 b52b3a6..4643fa8 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -946,6 +946,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 (blk_mq_hctx_stopped(hctx)) + 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 535ab2e..aa93000 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -223,6 +223,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);