Message ID | 20170831172728.15817-5-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Ming, On Fri, Sep 01, 2017 at 01:27:23AM +0800, Ming Lei wrote: > - blk_mq_run_hw_queues(q, false); > + if (q->mq_ops) > + blk_mq_run_hw_queues(q, false); What speaks against putting the if (q->mq_ops) directly into blk_mq_run_hw_queues() so we can't accidently call it from the sq path? Just an idea, no hard preferences here. Byte, Johannes
On Fri, Sep 01, 2017 at 10:16:34AM +0200, Johannes Thumshirn wrote: > Hi Ming, > > On Fri, Sep 01, 2017 at 01:27:23AM +0800, Ming Lei wrote: > > - blk_mq_run_hw_queues(q, false); > > + if (q->mq_ops) > > + blk_mq_run_hw_queues(q, false); > > What speaks against putting the if (q->mq_ops) directly into > blk_mq_run_hw_queues() so we can't accidently call it from the sq path? > > Just an idea, no hard preferences here. Given it is the only case that blk_mq_run_hw_queues() is run on !q->mq_ops now, I suggest to check q->mq_ops outside, otherwise it can be a bit overkill.
On Fri, Sep 01, 2017 at 08:33:40PM +0800, Ming Lei wrote: > Given it is the only case that blk_mq_run_hw_queues() is run on > !q->mq_ops now, I suggest to check q->mq_ops outside, otherwise > it can be a bit overkill. Fair enough, Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff --git a/block/blk-mq.c b/block/blk-mq.c index 8cf1f7cbef2b..4c532d8612e1 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -125,7 +125,8 @@ void blk_freeze_queue_start(struct request_queue *q) freeze_depth = atomic_inc_return(&q->mq_freeze_depth); if (freeze_depth == 1) { percpu_ref_kill(&q->q_usage_counter); - blk_mq_run_hw_queues(q, false); + if (q->mq_ops) + blk_mq_run_hw_queues(q, false); } } EXPORT_SYMBOL_GPL(blk_freeze_queue_start);
This patch just makes it explicitely. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)