diff mbox series

[2/2] block: use blk_mq_plug() in blk_execute_rq_nowait()

Message ID 20220925185348.120964-3-p.raghav@samsung.com (mailing list archive)
State New, archived
Headers show
Series enable plugging only for reads in zoned block devices | expand

Commit Message

Pankaj Raghav Sept. 25, 2022, 6:53 p.m. UTC
blk_execute_rq_nowait() function mainly was used by low-level drivers
such as NVMe to submit one-off passthrough requests. However, recently
introduced uring-cmd based io-passthrough also uses the same function to
submit io requests.

As the plugging support is coming to io-passthrough[1], use the
blk_mq_plug() helper to ensure plugging is not used in all scenarios.

[1]
https://lore.kernel.org/linux-block/20220922182805.96173-1-axboe@kernel.dk/

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Damien Le Moal Sept. 25, 2022, 10:56 p.m. UTC | #1
On 9/26/22 03:53, Pankaj Raghav wrote:
> blk_execute_rq_nowait() function mainly was used by low-level drivers
> such as NVMe to submit one-off passthrough requests. However, recently
> introduced uring-cmd based io-passthrough also uses the same function to
> submit io requests.
> 
> As the plugging support is coming to io-passthrough[1], use the
> blk_mq_plug() helper to ensure plugging is not used in all scenarios.
> 
> [1]
> https://lore.kernel.org/linux-block/20220922182805.96173-1-axboe@kernel.dk/
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>   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 c11949d66163..840541c1ab40 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1213,7 +1213,7 @@ void blk_execute_rq_nowait(struct request *rq, bool at_head)
>   	WARN_ON(!blk_rq_is_passthrough(rq));
>   
>   	blk_account_io_start(rq);
> -	if (current->plug)
> +	if (blk_mq_plug(rq->bio))
>   		blk_add_rq_to_plug(current->plug, rq);
>   	else
>   		blk_mq_sched_insert_request(rq, at_head, true, false);

Looks good to me.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index c11949d66163..840541c1ab40 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1213,7 +1213,7 @@  void blk_execute_rq_nowait(struct request *rq, bool at_head)
 	WARN_ON(!blk_rq_is_passthrough(rq));
 
 	blk_account_io_start(rq);
-	if (current->plug)
+	if (blk_mq_plug(rq->bio))
 		blk_add_rq_to_plug(current->plug, rq);
 	else
 		blk_mq_sched_insert_request(rq, at_head, true, false);