提交 4fee61a5 编写于 作者: J Jiufei Xue

iocost: fix a deadlock in ioc_rqos_throttle()

Function ioc_rqos_throttle() may called inside queue_lock.
We should unlock the queue_lock before entering sleep.
Signed-off-by: NJiufei Xue <jiufei.xue@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 cfde0248
......@@ -1692,6 +1692,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;
......@@ -1825,7 +1827,14 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio, spinlock_t *
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册