diff options
Diffstat (limited to 'block')
| -rw-r--r-- | block/blk-mq-debugfs.c | 1 | ||||
| -rw-r--r-- | block/blk-mq.c | 30 |
2 files changed, 2 insertions, 29 deletions
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 58b3b79cbe83..3080e18cb859 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c | |||
| @@ -235,7 +235,6 @@ static const char *const hctx_state_name[] = { | |||
| 235 | HCTX_STATE_NAME(STOPPED), | 235 | HCTX_STATE_NAME(STOPPED), |
| 236 | HCTX_STATE_NAME(TAG_ACTIVE), | 236 | HCTX_STATE_NAME(TAG_ACTIVE), |
| 237 | HCTX_STATE_NAME(SCHED_RESTART), | 237 | HCTX_STATE_NAME(SCHED_RESTART), |
| 238 | HCTX_STATE_NAME(START_ON_RUN), | ||
| 239 | }; | 238 | }; |
| 240 | #undef HCTX_STATE_NAME | 239 | #undef HCTX_STATE_NAME |
| 241 | 240 | ||
diff --git a/block/blk-mq.c b/block/blk-mq.c index e05bd10d5c84..c2c6d276da3a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -1562,40 +1562,14 @@ static void blk_mq_run_work_fn(struct work_struct *work) | |||
| 1562 | hctx = container_of(work, struct blk_mq_hw_ctx, run_work.work); | 1562 | hctx = container_of(work, struct blk_mq_hw_ctx, run_work.work); |
| 1563 | 1563 | ||
| 1564 | /* | 1564 | /* |
| 1565 | * If we are stopped, don't run the queue. The exception is if | 1565 | * If we are stopped, don't run the queue. |
| 1566 | * BLK_MQ_S_START_ON_RUN is set. For that case, we auto-clear | ||
| 1567 | * the STOPPED bit and run it. | ||
| 1568 | */ | 1566 | */ |
| 1569 | if (test_bit(BLK_MQ_S_STOPPED, &hctx->state)) { | 1567 | if (test_bit(BLK_MQ_S_STOPPED, &hctx->state)) |
| 1570 | if (!test_bit(BLK_MQ_S_START_ON_RUN, &hctx->state)) | ||
| 1571 | return; | ||
| 1572 | |||
| 1573 | clear_bit(BLK_MQ_S_START_ON_RUN, &hctx->state); | ||
| 1574 | clear_bit(BLK_MQ_S_STOPPED, &hctx->state); | 1568 | clear_bit(BLK_MQ_S_STOPPED, &hctx->state); |
| 1575 | } | ||
| 1576 | 1569 | ||
| 1577 | __blk_mq_run_hw_queue(hctx); | 1570 | __blk_mq_run_hw_queue(hctx); |
| 1578 | } | 1571 | } |
| 1579 | 1572 | ||
| 1580 | |||
| 1581 | void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs) | ||
| 1582 | { | ||
| 1583 | if (WARN_ON_ONCE(!blk_mq_hw_queue_mapped(hctx))) | ||
| 1584 | return; | ||
| 1585 | |||
| 1586 | /* | ||
| 1587 | * Stop the hw queue, then modify currently delayed work. | ||
| 1588 | * This should prevent us from running the queue prematurely. | ||
| 1589 | * Mark the queue as auto-clearing STOPPED when it runs. | ||
| 1590 | */ | ||
| 1591 | blk_mq_stop_hw_queue(hctx); | ||
| 1592 | set_bit(BLK_MQ_S_START_ON_RUN, &hctx->state); | ||
| 1593 | kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), | ||
| 1594 | &hctx->run_work, | ||
| 1595 | msecs_to_jiffies(msecs)); | ||
| 1596 | } | ||
| 1597 | EXPORT_SYMBOL(blk_mq_delay_queue); | ||
| 1598 | |||
| 1599 | static inline void __blk_mq_insert_req_list(struct blk_mq_hw_ctx *hctx, | 1573 | static inline void __blk_mq_insert_req_list(struct blk_mq_hw_ctx *hctx, |
| 1600 | struct request *rq, | 1574 | struct request *rq, |
| 1601 | bool at_head) | 1575 | bool at_head) |
