From patchwork Sat Oct 29 00:19:37 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: 9402883 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 5F7E06022E for ; Sat, 29 Oct 2016 00:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42EE22A8FA for ; Sat, 29 Oct 2016 00:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3771F2A900; Sat, 29 Oct 2016 00:19:52 +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 AC5B42A8FA for ; Sat, 29 Oct 2016 00:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756678AbcJ2ATu (ORCPT ); Fri, 28 Oct 2016 20:19:50 -0400 Received: from mail-bn3nam01on0043.outbound.protection.outlook.com ([104.47.33.43]:3536 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753086AbcJ2ATs (ORCPT ); Fri, 28 Oct 2016 20:19:48 -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=lgpYPC6DLxhqnI2IeNuF64V6MLVIQTPojjj2e1Ztnk4=; b=JO34d5h1KHQKlQXHfvHkwCz8eM1k5XLNhqzncNxZMqOTlEUfbcDyKhKSBnm1hZGE26kGAaNKpEnxSa2e6TAso01e0bGi0Ip4cfnU9nCRepKaqJvV13ksNe57brr7gAnV+Z0o3V9h0PYtoQqXC0d39unQH3v7G6qZC/jyruF2CsA= Received: from BN6PR02CA0047.namprd02.prod.outlook.com (10.173.146.161) by BY2PR02MB266.namprd02.prod.outlook.com (10.242.236.143) 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:45 +0000 Received: from BY2FFO11OLC006.protection.gbl (2a01:111:f400:7c0c::140) by BN6PR02CA0047.outlook.office365.com (2603:10b6:404:5f::33) 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:39 +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 BY2FFO11OLC006.mail.protection.outlook.com (10.1.14.199) 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:38 +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 40.2F.26959.388E3185; Fri, 28 Oct 2016 17:08:35 -0700 (PDT) Received: from milsmgip11.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; Fri, 28 Oct 2016 17:19:38 -0700 X-AuditID: 0ac94369-b97ff7000001694f-eb-5813e8834c6d Received: from exp-402881.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id EE.EF.02564.A1BE3185; Fri, 28 Oct 2016 17:19:38 -0700 (PDT) Subject: [PATCH v5 03/14] blk-mq: Introduce blk_mq_queue_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: <53234c01-f3f1-27cc-a21a-85486cff24c7@sandisk.com> Date: Fri, 28 Oct 2016 17:19:37 -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+NgFtrHIsWRmVeSWpSXmKPExsXCddJ5kW7zC+EIg5nbBS3+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi2WLnzJa7L2lbTF/2VN2i2eHelksuq/vYLM4/+EVk8Xy4/+YLGac X8xq0bbxK6PF+x/X2R34PV5PnsDoMbH5HbvHzll32T0W73nJ5PHg0GYWj81L6j1232xg8/j4 9BaLx/t9V9k8Pm+SC+CK4rJJSc3JLEst0rdL4MpYufU4Y8E6gYqfj1+zNDB+4O1i5OSQEDCR uLV+BmMXIxeHkMBSJ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W2v53DPIGRbxaSlllIymYhKVvAyLyKUSw3M6c4Nz2zwNBQrzgx LyWzOFsvOT93EyMkZiJ3MD6daH6IkYmDU6qB0W/qH9Oc+4eeim/R9H3seS20ZuPry3s6fq4s nryUf5eitu6Z7ve7Ol7X/lu8bKPogi3nHFb85I/bvW+eRbFGqtAkHVd9kX/ylouXOrcWV8+c H2u/ceXzGw0RaVfTLL7NKdy+J8P7tKceb/viL9M3saUzmd7Ou/vmaWjF/Y+Tzque+mpj6HF2 y1IlluKMREMt5qLiRAA37Av5SQIAAA== 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)(6916009)(23676002)(110136003)(92566002)(5660300001)(2270400002)(77096005)(65826007)(8936002)(586003)(83506001)(2906002)(626004)(2950100002)(69596002)(65806001)(65956001)(7416002)(47776003)(87936001)(189998001)(54356999)(230700001)(76176999)(50986999)(86362001)(4326007)(81166006)(8676002)(575784001)(97736004)(53416004)(4001350100001)(31696002)(106466001)(33646002)(19580395003)(19580405001)(36756003)(305945005)(81156014)(356003)(8666005)(64126003)(7846002)(50466002)(31686004)(229853001)(68736007)(11100500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB266; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC006; 1:qRfl6x64jaqpsYEJ0HJT61SdAlr3lHW5Wl5+0jfe1dtg4y5KQ4bIUdROAXdtgl3GfVYRp0vciP7H9PfGkmDGYThfq95a6rkM8crFU3WGjJSBaPomKCBEgj2te5x/XavvaK8sOCvF9U1u+yLgx16Wvld5/fdzsr8NjLSF6lQvV/I9NpwvRYt6wcQiQhDsLNg6jPlnQdeh01s06n0DnwG0nnOc+jsY7xEgefVtDnDvmbR+8QR0x4lS7OPmGkbIDRJYQgVASdaKEfybd/dLeEoRIfe3qTVNeaV3/0YQT4lAxgnSdmtnX4JDhIAMS+l9A3SRhdujdyC0TYAWuFvkRUHKrc+/+x84ymeUdExBcAEKB4ixw9X2YL4t2fJco2iDg/kCs9URXsj3O0Ce3qn9NtI5LCwwxBvUqnnwXhIrhelVc8oLFhy2wQGgZLYxZR7jemeiPsWsJX9NofrIgMdcU+v26LgXe5SZRy/o2wOKFSkT68a5vU1gb90HEyFox0reMBQdWy1uKXyDw2+Y5D2Mvtn7x2J/q2EB/QFIJNvxnvleFwTVdsWwR7ii8L0s08EgITkc X-MS-Office365-Filtering-Correlation-Id: 451478ec-8fcd-41ef-dd63-08d3ff914577 X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB266; 2:UeZpWJPjfbTV2uLnc3+isVDYZLGlgb+0XZZnuBkn/2mdhm+btn57oC1fFIRdGjhVqegytmLWslXcNwjMSiRV4ypq7rrjRl6AkX71mRoyAkNNUCZdLqAyvejENhFXNwOp7EdrK6XwcoKDFx5zCXUkf6gl8x9rA9hlQ/XrHBBihnTNLGuZaLxFdFQ8T5/AX+fqYmyd6FLrEYksrTbUF06fOQ==; 3:R0wPVUoHd3JOTkYifQNhlO5+gxl/BGMvhBuSxSh7Dr7l2LVi1I/DMA0FtnpJJ3T1NWZXie7bmwODo24x6mTW57zHF6bqh+qNnara9+UckvopIuLBsMNFI4/JW8ZJqkoh/wy7vnSyqjMTG7TavWzSPcLueRsrgxSg/2sJFfD7mVleV7druXhNx4GLuKVBx1EmI7JKYNoIlTV1b/nx29kvXy4xMV8fCXl0ZMulPhHJh2Ctfts4A98OdmCxtFv5tKzSbVdkL9xubQ5J2Ps6AtEJpXDyBp5ikYWKqgeK3nMyisk= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BY2PR02MB266; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB266; 25:tO6XRBLP9mY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bCcoK+GdvZQcl6Qkew32R0HYZoPF2wlLbk2GdOewdBGBV7bl+tm63O7PTSgNb+qtrMBoQwEgSwt4Ptr8gCXSl2uRrd/x5WUhAneUcnuXQWvHoE950dacGzq7IkhLEmi6JHo0bbIbHYDfmkLzEMpZzYcpN/ZqhDsU9AnEtefIyW0htrrq5tGdmLA1p 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)(8121501046)(5005006)(13016025)(3002001)(10201501046)(6055026); SRVR:BY2PR02MB266; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB266; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB266; 4:hAU3+LGh4Zs6mb5FprnpW/iL0CjWESMYErTB+kylY5YjEOt72oC1fCZ+3cLwZAtOn2/t4NdtoqFMQ/8X/RLYC/2P3dlVNUqwGvSMvxeQX5O1hLFJ3WF9SlOg61sJMXkxxM73zDANZi3TSswwM7PStJmQ90gGjV/O6KZrvH1ld4JvnDKhNSCPjxZPpBn3saEWS5O9kbYUvcj7xdeHjyaIf5JWamlhz/kxsQTSToiquKN0xhUNHt4M2F4/AdtjChYV9K/dv9SZypHYoIlagf28y3snGSrkEeRk+tfqRJWSyy2kyh/dxkZfVQ4XnKQZbJ7mbUXZmY+BQGL+jcbR08b+fjD6vqh3xCW4TRHhNXexIojhfUFQ7KVCtzkZxwa4/+psNk33LOWcQ4VMwd/hP6KvOISiVkfp8Iby2DujyeXfUfFUhtJtTDs2p1PUnQbuNP/gRzSQcjHqHk+fCQZpk4hPDB6hL5Yxeegr+5/7TN2U4/iNJG/UB17Kl/spJXjNFxSg X-Forefront-PRVS: 01106E96F6 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyTUIyNjY7MjM6WWJ6cFp6V1FsQ3FST2tSQUR2MzdaYlozeERO?= =?utf-8?B?N2ZzSzNEakp3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iV4QxPks=; 20:Mkll3+UnkXfPKknwFX1lXgYRncRaEK7SqYpiXRQnG/u3Y+0kggquU9iIpre09xT9d27Z/5APbITeffRIE52hzE5E2c+CrIZqg5gnj5VWwAIg9yJMzOZcJcyKYbzjSVuyQctaYg0KjnJxormufQ+UXg4Sk9en8S7N6qGlb++KEUy7lnlKNP1v1TV1o2t2vPHDbkCQ2pokwJmOiDjoVwyGNPL8t0q8trqFMwTNx4C8v4pRUNGl+5eXEoodOxq5p9Mr X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2016 00:19:38.8792 (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: BY2PR02MB266 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 Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn 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 bc1f462..283e0eb 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);