Skip to content

Commit 641a9ed

Browse files
Ming Leiaxboe
authored andcommitted
Revert "blk-mq: don't use sync workqueue flushing from drivers"
This patch reverts commit 2719aa2(blk-mq: don't use sync workqueue flushing from drivers) because only blk_mq_quiesce_queue() need the sync flush, and now we don't need to stop queue any more, so revert it. Also changes to cancel_delayed_work() in blk_mq_stop_hw_queue(). Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 39a70c7 commit 641a9ed

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

block/blk-mq.c

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ static LIST_HEAD(all_q_list);
4242

4343
static void blk_mq_poll_stats_start(struct request_queue *q);
4444
static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb);
45-
static void __blk_mq_stop_hw_queues(struct request_queue *q, bool sync);
4645

4746
static int blk_mq_poll_stats_bkt(const struct request *rq)
4847
{
@@ -1194,16 +1193,6 @@ bool blk_mq_queue_stopped(struct request_queue *q)
11941193
}
11951194
EXPORT_SYMBOL(blk_mq_queue_stopped);
11961195

1197-
static void __blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx, bool sync)
1198-
{
1199-
if (sync)
1200-
cancel_delayed_work_sync(&hctx->run_work);
1201-
else
1202-
cancel_delayed_work(&hctx->run_work);
1203-
1204-
set_bit(BLK_MQ_S_STOPPED, &hctx->state);
1205-
}
1206-
12071196
/*
12081197
* This function is often used for pausing .queue_rq() by driver when
12091198
* there isn't enough resource or some conditions aren't satisfied, and
@@ -1215,18 +1204,11 @@ static void __blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx, bool sync)
12151204
*/
12161205
void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx)
12171206
{
1218-
__blk_mq_stop_hw_queue(hctx, false);
1219-
}
1220-
EXPORT_SYMBOL(blk_mq_stop_hw_queue);
1207+
cancel_delayed_work(&hctx->run_work);
12211208

1222-
static void __blk_mq_stop_hw_queues(struct request_queue *q, bool sync)
1223-
{
1224-
struct blk_mq_hw_ctx *hctx;
1225-
int i;
1226-
1227-
queue_for_each_hw_ctx(q, hctx, i)
1228-
__blk_mq_stop_hw_queue(hctx, sync);
1209+
set_bit(BLK_MQ_S_STOPPED, &hctx->state);
12291210
}
1211+
EXPORT_SYMBOL(blk_mq_stop_hw_queue);
12301212

12311213
/*
12321214
* This function is often used for pausing .queue_rq() by driver when
@@ -1239,7 +1221,11 @@ static void __blk_mq_stop_hw_queues(struct request_queue *q, bool sync)
12391221
*/
12401222
void blk_mq_stop_hw_queues(struct request_queue *q)
12411223
{
1242-
__blk_mq_stop_hw_queues(q, false);
1224+
struct blk_mq_hw_ctx *hctx;
1225+
int i;
1226+
1227+
queue_for_each_hw_ctx(q, hctx, i)
1228+
blk_mq_stop_hw_queue(hctx);
12431229
}
12441230
EXPORT_SYMBOL(blk_mq_stop_hw_queues);
12451231

0 commit comments

Comments
 (0)