2018-06-04 09:04:03

by jianchao.wang

[permalink] [raw]
Subject: [PATCH] blk-mq: return when BLK_MQ_S_STOPPED in blk_mq_run_work_fn

if hctx is stopped, don't run the queue in blk_mq_run_work_fn.

Fixes: 15fe8a9 (blk-mq: remove blk_mq_delay_queue())
Cc: Ming Lei <[email protected]>
Signed-off-by: Jianchao Wang <[email protected]>
---
block/blk-mq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 9ce9cac..d0ee928 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1578,7 +1578,7 @@ static void blk_mq_run_work_fn(struct work_struct *work)
* If we are stopped, don't run the queue.
*/
if (test_bit(BLK_MQ_S_STOPPED, &hctx->state))
- clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
+ return;

__blk_mq_run_hw_queue(hctx);
}
--
2.7.4



2018-06-04 10:44:27

by Ming Lei

[permalink] [raw]
Subject: Re: [PATCH] blk-mq: return when BLK_MQ_S_STOPPED in blk_mq_run_work_fn

On Mon, Jun 04, 2018 at 05:03:55PM +0800, Jianchao Wang wrote:
> if hctx is stopped, don't run the queue in blk_mq_run_work_fn.
>
> Fixes: 15fe8a9 (blk-mq: remove blk_mq_delay_queue())
> Cc: Ming Lei <[email protected]>
> Signed-off-by: Jianchao Wang <[email protected]>
> ---
> block/blk-mq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 9ce9cac..d0ee928 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1578,7 +1578,7 @@ static void blk_mq_run_work_fn(struct work_struct *work)
> * If we are stopped, don't run the queue.
> */
> if (test_bit(BLK_MQ_S_STOPPED, &hctx->state))
> - clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
> + return;
>
> __blk_mq_run_hw_queue(hctx);
> }
> --
> 2.7.4
>

Reviewed-by: Ming Lei <[email protected]>

Thanks,
Ming

2018-06-04 11:37:48

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH] blk-mq: return when BLK_MQ_S_STOPPED in blk_mq_run_work_fn

On Mon, 2018-06-04 at 17:03 +0800, Jianchao Wang wrote:
> if hctx is stopped, don't run the queue in blk_mq_run_work_fn.

Reviewed-by: Bart Van Assche <[email protected]>



2018-06-04 16:23:13

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] blk-mq: return when BLK_MQ_S_STOPPED in blk_mq_run_work_fn

On 6/4/18 3:03 AM, Jianchao Wang wrote:
> if hctx is stopped, don't run the queue in blk_mq_run_work_fn.

I was puzzled, so had to look up those changes. That's definitely
a regression caused by 15fe8a9, as you highlighted. Looks good to
me, I'll apply it.

BTW, this should have been explained in the commit message. I'll
change it a bit.

--
Jens Axboe