Re: [PATCH 1/6] blk-mq: make blk_mq_stop_hw_queue() reliably block queue processing

From: Tejun Heo
Date: Thu Jun 19 2014 - 09:12:28 EST


Hello, Ming.

On Thu, Jun 19, 2014 at 06:10:28PM +0800, Ming Lei wrote:
> > void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx)
> > {
> > - cancel_delayed_work(&hctx->run_work);
> > - cancel_delayed_work(&hctx->delay_work);
> > set_bit(BLK_MQ_S_STOPPED, &hctx->state);
> > + cancel_delayed_work_sync(&hctx->run_work);
> > + cancel_delayed_work_sync(&hctx->delay_work);
>
> The function can be called from atomic context, like virtio-blk.
>
> Currently blk_mq_stop_hw_queue() is called in case of queue
> being busy, so looks it is ok with cancel_delayed_work().

Hmm... you're right. So the function is used to stop future
invocations of the queue processing function and thus the order
doesn't matter. We probably wanna document that. I don't understand
why virblk_freeze() is invoking it tho. If freezing is complete,
there's no request in-flight on the driver side, why does it need to
invoke stop too?

Jens, please drop this one.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/