* [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void
@ 2019-10-29 16:59 John Garry
2019-10-31 10:10 ` Bob Liu
2019-11-01 14:43 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2019-10-29 16:59 UTC (permalink / raw)
To: axboe; +Cc: linux-block, linux-kernel, John Garry
Since commit 97889f9ac24f ("blk-mq: remove synchronize_rcu() from
blk_mq_del_queue_tag_set()"), the return value of blk_mq_run_hw_queue()
is never checked, so make it return void, which very marginally simplifies
the code.
Signed-off-by: John Garry <john.garry@huawei.com>
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ec791156e9cc..8daa9740929a 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1486,7 +1486,7 @@ void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs)
}
EXPORT_SYMBOL(blk_mq_delay_run_hw_queue);
-bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
+void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
{
int srcu_idx;
bool need_run;
@@ -1504,12 +1504,8 @@ bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
blk_mq_hctx_has_pending(hctx);
hctx_unlock(hctx, srcu_idx);
- if (need_run) {
+ if (need_run)
__blk_mq_delay_run_hw_queue(hctx, async, 0);
- return true;
- }
-
- return false;
}
EXPORT_SYMBOL(blk_mq_run_hw_queue);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 0bf056de5cc3..c963038dfb92 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -324,7 +324,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
void blk_mq_quiesce_queue(struct request_queue *q);
void blk_mq_unquiesce_queue(struct request_queue *q);
void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
-bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
+void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
void blk_mq_run_hw_queues(struct request_queue *q, bool async);
void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
busy_tag_iter_fn *fn, void *priv);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void
2019-10-29 16:59 [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void John Garry
@ 2019-10-31 10:10 ` Bob Liu
2019-11-01 14:43 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Bob Liu @ 2019-10-31 10:10 UTC (permalink / raw)
To: John Garry, axboe; +Cc: linux-block, linux-kernel
On 10/30/19 12:59 AM, John Garry wrote:
> Since commit 97889f9ac24f ("blk-mq: remove synchronize_rcu() from
> blk_mq_del_queue_tag_set()"), the return value of blk_mq_run_hw_queue()
> is never checked, so make it return void, which very marginally simplifies
> the code.
>
> Signed-off-by: John Garry <john.garry@huawei.com>
>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index ec791156e9cc..8daa9740929a 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1486,7 +1486,7 @@ void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs)
> }
> EXPORT_SYMBOL(blk_mq_delay_run_hw_queue);
>
> -bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
> +void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
> {
> int srcu_idx;
> bool need_run;
> @@ -1504,12 +1504,8 @@ bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
> blk_mq_hctx_has_pending(hctx);
> hctx_unlock(hctx, srcu_idx);
>
> - if (need_run) {
> + if (need_run)
> __blk_mq_delay_run_hw_queue(hctx, async, 0);
> - return true;
> - }
> -
> - return false;
> }
> EXPORT_SYMBOL(blk_mq_run_hw_queue);
>
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index 0bf056de5cc3..c963038dfb92 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -324,7 +324,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
> void blk_mq_quiesce_queue(struct request_queue *q);
> void blk_mq_unquiesce_queue(struct request_queue *q);
> void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
> -bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
> +void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
> void blk_mq_run_hw_queues(struct request_queue *q, bool async);
> void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
> busy_tag_iter_fn *fn, void *priv);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void
2019-10-29 16:59 [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void John Garry
2019-10-31 10:10 ` Bob Liu
@ 2019-11-01 14:43 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2019-11-01 14:43 UTC (permalink / raw)
To: John Garry; +Cc: linux-block, linux-kernel
On 10/29/19 10:59 AM, John Garry wrote:
> Since commit 97889f9ac24f ("blk-mq: remove synchronize_rcu() from
> blk_mq_del_queue_tag_set()"), the return value of blk_mq_run_hw_queue()
> is never checked, so make it return void, which very marginally simplifies
> the code.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-01 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 16:59 [PATCH] blk-mq: Make blk_mq_run_hw_queue() return void John Garry
2019-10-31 10:10 ` Bob Liu
2019-11-01 14:43 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.