diff mbox series

[1/3] block: Requeue req as head if driver touched it

Message ID 22aa78389c9b4613841716c5b7bd89aa@hyperstone.com
State Superseded
Headers show
Series [1/3] block: Requeue req as head if driver touched it | expand

Commit Message

Christian Loehle Oct. 26, 2022, 7:30 a.m. UTC
In case the driver set RQF_DONTPREP flag, requeue the request as head as
it is likely that the backing storage already had a request to an
adjacent region, so getting the requeued request out as soon as possible
may give us some performance benefit.

Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson Nov. 11, 2022, 10:30 a.m. UTC | #1
On Wed, 26 Oct 2022 at 09:30, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> In case the driver set RQF_DONTPREP flag, requeue the request as head as
> it is likely that the backing storage already had a request to an
> adjacent region, so getting the requeued request out as soon as possible
> may give us some performance benefit.

This is a bit handwavy to me. Would you mind extending this with a
small concrete example, to better understand the benefit?

>
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>

Other than the above nitpick, I can't think of any obvious unwanted
side-effects this could have. So, feel free to add:

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  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 33292c01875d..d863c826fb23 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1429,7 +1429,7 @@ static void blk_mq_requeue_work(struct work_struct *work)
>                  * merge.
>                  */
>                 if (rq->rq_flags & RQF_DONTPREP)
> -                       blk_mq_request_bypass_insert(rq, false, false);
> +                       blk_mq_request_bypass_insert(rq, true, false);
>                 else
>                         blk_mq_sched_insert_request(rq, true, false, false);
>         }
> --
> 2.37.3
> Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
>
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 33292c01875d..d863c826fb23 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1429,7 +1429,7 @@  static void blk_mq_requeue_work(struct work_struct *work)
 		 * merge.
 		 */
 		if (rq->rq_flags & RQF_DONTPREP)
-			blk_mq_request_bypass_insert(rq, false, false);
+			blk_mq_request_bypass_insert(rq, true, false);
 		else
 			blk_mq_sched_insert_request(rq, true, false, false);
 	}