From 41aed7734d17ab1e464e65f95a7a1dfb534d0a42 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 11:31:09 +0100 Subject: [PATCH 357/365] Revert "block: blk-mq: Use swait" This reverts commit "block: blk-mq: Use swait". The issue remains but will be fixed differently. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior (cherry-picked from ca3fd6cf836739fd59eac2f7a9b0261365e818bb) Signed-off-by: Julia Cartwright --- block/blk-core.c | 10 +++++----- block/blk-mq.c | 6 +++--- include/linux/blkdev.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 2ce6dee96262..ebac0d312d3d 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -664,9 +664,9 @@ int blk_queue_enter(struct request_queue *q, bool nowait) if (nowait) return -EBUSY; - swait_event(q->mq_freeze_wq, - !atomic_read(&q->mq_freeze_depth) || - blk_queue_dying(q)); + wait_event(q->mq_freeze_wq, + !atomic_read(&q->mq_freeze_depth) || + blk_queue_dying(q)); if (blk_queue_dying(q)) return -ENODEV; } @@ -682,7 +682,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); - swake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_freeze_wq); } static void blk_rq_timed_out_timer(unsigned long data) @@ -755,7 +755,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_swait_queue_head(&q->mq_freeze_wq); + init_waitqueue_head(&q->mq_freeze_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 9a505b9361ee..d877210e9a1b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -69,7 +69,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_start); void blk_mq_freeze_queue_wait(struct request_queue *q) { - swait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->q_usage_counter)); + wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->q_usage_counter)); } EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait); @@ -117,7 +117,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); - swake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_freeze_wq); } } EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); @@ -136,7 +136,7 @@ void blk_mq_wake_waiters(struct request_queue *q) * dying, we need to ensure that processes currently waiting on * the queue are notified as well. */ - swake_up_all(&q->mq_freeze_wq); + wake_up_all(&q->mq_freeze_wq); } bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9d56ed8ccbaf..552fb3fb991b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -477,7 +477,7 @@ struct request_queue { struct throtl_data *td; #endif struct rcu_head rcu_head; - struct swait_queue_head mq_freeze_wq; + wait_queue_head_t mq_freeze_wq; struct percpu_ref q_usage_counter; struct list_head all_q_node; -- 2.28.0