From patchwork Mon Jan 8 18:50:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10150305 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 4EECB60210 for ; Mon, 8 Jan 2018 18:50:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BD6E289D7 for ; Mon, 8 Jan 2018 18:50:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 508D8289DE; Mon, 8 Jan 2018 18:50:27 +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 E4972289D7 for ; Mon, 8 Jan 2018 18:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755991AbeAHSuT (ORCPT ); Mon, 8 Jan 2018 13:50:19 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:60235 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755930AbeAHSuR (ORCPT ); Mon, 8 Jan 2018 13:50:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1515437419; x=1546973419; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=7T4+pi6I5n7uCMo1rZjzXMr6zT0v4JCTci40CCKvT1Y=; b=SRbXFWLauyx1tZWNCBHZ/m0KPnfcG7GL8V5cvFSVyiE46/XE9nhzcp5V Mim1CSQU6fQ5Fu21vFIIGUlwGBOn8eV9qEs0wWaVwoOwPL5OOiG88aogn Qf+1Qlp0VOtWuDd9VBMo4o6AgAONMKHHXYeFVyQn0KuDL2VE7lrs3Nard s6fbjZplUPd2N/cBXNe0iNNSxKkRimh2BwPLOM5J0arFj3Vf0fA5XUr0J fh5Y9szWDJ+NR2qa+T+5clj4vMcYuZnYEEMo7dnIGMZf5HiIgZlSp7xDV W7GYaq7ySn9TqrG0Xi9eyS7lmKVSzhD6kCtl2epL2CBOnxO8SEamI6fRr Q==; X-IronPort-AV: E=Sophos;i="5.46,332,1511798400"; d="scan'208";a="68074216" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Jan 2018 02:50:13 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jan 2018 10:45:47 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jan 2018 10:50:12 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Jason Gunthorpe , Doug Ledford , linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Ming Lei Subject: [PATCH 1/4] blk-mq: Rename request_queue.mq_freeze_wq into mq_wq Date: Mon, 8 Jan 2018 10:50:08 -0800 Message-Id: <20180108185011.30018-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108185011.30018-1-bart.vanassche@wdc.com> References: <20180108185011.30018-1-bart.vanassche@wdc.com> 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 Rename a waitqueue in struct request_queue since the next patch will add code that uses this waitqueue outside the request queue freezing implementation. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Ming Lei Reviewed-by: Hannes Reinecke --- block/blk-core.c | 10 +++++----- block/blk-mq.c | 10 +++++----- include/linux/blkdev.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 8f27ab14abce..605599a2ab3b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -375,7 +375,7 @@ void blk_clear_preempt_only(struct request_queue *q) spin_lock_irqsave(q->queue_lock, flags); queue_flag_clear(QUEUE_FLAG_PREEMPT_ONLY, q); - wake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_wq); spin_unlock_irqrestore(q->queue_lock, flags); } EXPORT_SYMBOL_GPL(blk_clear_preempt_only); @@ -651,7 +651,7 @@ void blk_set_queue_dying(struct request_queue *q) } /* Make blk_queue_enter() reexamine the DYING flag. */ - wake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_wq); } EXPORT_SYMBOL_GPL(blk_set_queue_dying); @@ -854,7 +854,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) */ smp_rmb(); - ret = wait_event_interruptible(q->mq_freeze_wq, + ret = wait_event_interruptible(q->mq_wq, (atomic_read(&q->mq_freeze_depth) == 0 && (preempt || !blk_queue_preempt_only(q))) || blk_queue_dying(q)); @@ -875,7 +875,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) struct request_queue *q = container_of(ref, struct request_queue, q_usage_counter); - wake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_wq); } static void blk_rq_timed_out_timer(struct timer_list *t) @@ -951,7 +951,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) q->bypass_depth = 1; __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); - init_waitqueue_head(&q->mq_freeze_wq); + init_waitqueue_head(&q->mq_wq); /* * Init percpu_ref in atomic mode so that it's faster to shutdown. diff --git a/block/blk-mq.c b/block/blk-mq.c index 21c21ca13072..8118890fb66f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -138,16 +138,16 @@ EXPORT_SYMBOL_GPL(blk_freeze_queue_start); void blk_mq_freeze_queue_wait(struct request_queue *q) { - wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->q_usage_counter)); + wait_event(q->mq_wq, percpu_ref_is_zero(&q->q_usage_counter)); } EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait); int blk_mq_freeze_queue_wait_timeout(struct request_queue *q, unsigned long timeout) { - return wait_event_timeout(q->mq_freeze_wq, - percpu_ref_is_zero(&q->q_usage_counter), - timeout); + return wait_event_timeout(q->mq_wq, + percpu_ref_is_zero(&q->q_usage_counter), + timeout); } EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait_timeout); @@ -186,7 +186,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) WARN_ON_ONCE(freeze_depth < 0); if (!freeze_depth) { percpu_ref_reinit(&q->q_usage_counter); - wake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_wq); } } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 742c0d9aed6b..26c4d4343edb 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -613,7 +613,7 @@ struct request_queue { struct throtl_data *td; #endif struct rcu_head rcu_head; - wait_queue_head_t mq_freeze_wq; + wait_queue_head_t mq_wq; struct percpu_ref q_usage_counter; struct list_head all_q_node;