Re: [RFC PATCH 13/14] block: simplify runtime PM support

Bart Van Assche
2018-08-07T19:54:44Z

On Wed, 2018-08-08 at 01:44 +0800, Ming Lei wrote:
> @@ -3772,6 +3764,7 @@ int blk_pre_runtime_su=
spend(struct request_queue *q)
> if (!q->dev)
> return ret;
> =20
> + mutex_lock(&q->pm_lock);
> spin_lock_irq(q->queue_lock);
> if (q->nr_pending) {
> ret = -EBUSY;
> @@ -3780,6 +3773,13 @@ int blk_pre_runtime_s=
uspend(struct request_queue *q)
> q->rpm_status = RPM_SUSPENDING;
> }

Hello Ming,

As far as I can see none of the patches in this series adds a call to
blk_pm_add_request() in the blk-mq code. Does that mean that q-=
>nr_pending
will always be zero for blk-mq code with your approach and hence that runti=
me
suspend can get triggered while I/O is in progress, e.g. if blk_queue=
F8-enter()
is called concurrently with blk_pre_runtime_suspend()?

Thanks,

Bart.