Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: chengkaitao <pilgrimtao@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	chengkaitao <chengkaitao@kylinos.cn>,
	Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH RESEND] block/mq-deadline: adjust the timeout period of the per_prio->dispatch
Date: Thu, 2 Oct 2025 15:27:07 -0600	[thread overview]
Message-ID: <ad0f4a85-d7cc-4f47-b469-6903168c062a@kernel.dk> (raw)
In-Reply-To: <20250926023818.16223-1-pilgrimtao@gmail.com>

On 9/25/25 8:38 PM, chengkaitao wrote:
> From: chengkaitao <chengkaitao@kylinos.cn>
> 
> Reference function started_after()
> Before modification:
> 	Timeout for dispatch{read}: 9.5s
> 	started_after - 0.5s < latest_start - 10s
> 	9.5s < latest_start - started_after
> 
> 	Timeout for dispatch{write}: 5s
> 	started_after - 5s < latest_start - 10s
> 	5s < latest_start - started_after
> 
> At this point, write requests have higher priority than read requests.
> 
> After modification:
> 	Timeout for dispatch{read/write}: 5s
> 	prio_aging_expire / 2 < latest_start - started_after
> 
> Signed-off-by: chengkaitao <chengkaitao@kylinos.cn>
> ---
>  block/mq-deadline.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index b9b7cdf1d3c9..f311168f8dfe 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -672,7 +672,8 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  
>  	if (flags & BLK_MQ_INSERT_AT_HEAD) {
>  		list_add(&rq->queuelist, &per_prio->dispatch);
> -		rq->fifo_time = jiffies;
> +		rq->fifo_time = jiffies + dd->fifo_expire[data_dir]
> +				- dd->prio_aging_expire / 2;
>  	} else {
>  		deadline_add_rq_rb(per_prio, rq);
>  

Adding Damien as he's worked on mq-deadline the most recently.

-- 
Jens Axboe


  reply	other threads:[~2025-10-02 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26  2:38 [PATCH RESEND] block/mq-deadline: adjust the timeout period of the per_prio->dispatch chengkaitao
2025-10-02 21:27 ` Jens Axboe [this message]
2025-10-03  4:17 ` Damien Le Moal
2025-10-03  4:19 ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad0f4a85-d7cc-4f47-b469-6903168c062a@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=chengkaitao@kylinos.cn \
    --cc=dlemoal@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pilgrimtao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox