Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Revert "block: blk-mq: Use swait"
Browse files Browse the repository at this point in the history
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 <bigeasy@linutronix.de>
(cherry-picked from ca3fd6cf836739fd59eac2f7a9b0261365e818bb)
Signed-off-by: Julia Cartwright <julia@ni.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and andrewkim-pkt committed Jan 22, 2019
1 parent a0d6341 commit 8bed9d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,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;
}
Expand All @@ -680,7 +680,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)
Expand Down Expand Up @@ -750,7 +750,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.
Expand Down
6 changes: 3 additions & 3 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_start);

static 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));
}

/*
Expand Down Expand Up @@ -110,7 +110,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);
Expand All @@ -129,7 +129,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)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,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;

Expand Down

0 comments on commit 8bed9d5

Please sign in to comment.