diff --git a/block/blk-iocost.c b/block/blk-iocost.c index b8d258e82073d3ecd4689fdb8262005b73f6d5aa..8aa5a79a8fa06c9d48d5189dfbb9541d08151dee 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1678,6 +1678,8 @@ static u64 calc_vtime_cost(struct bio *bio, struct ioc_gq *iocg, bool is_merge) static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio, spinlock_t *lock) + __releases(lock) + __acquires(lock) { struct ioc *ioc = rqos_to_ioc(rqos); struct request_queue *q = rqos->q; @@ -1814,7 +1816,14 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio, set_current_state(TASK_UNINTERRUPTIBLE); if (wait.committed) break; - io_schedule(); + + if (lock) { + spin_unlock_irq(lock); + io_schedule(); + spin_lock_irq(lock); + } else { + io_schedule(); + } } /* waker already committed us, proceed */