archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <>
To: Niklas Cassel <>
Cc: Jens Axboe <>,
	Bart Van Assche <>,
	Damien Le Moal <>,
	Paolo Valente <>,
	"" <>,
	"" <>
Subject: Re: [RFC PATCH 1/2] blk-mq: don't call callbacks for requests that bypassed the scheduler
Date: Fri, 27 Aug 2021 21:28:07 +0800	[thread overview]
Message-ID: <YSjoZ/cul4w2l8tG@T590> (raw)
In-Reply-To: <>

On Fri, Aug 27, 2021 at 12:41:31PM +0000, Niklas Cassel wrote:
> From: Niklas Cassel <>
> Currently, __blk_mq_alloc_request() calls ops.prepare_request and sets
> Therefore, (if the request is not a flush) the RQF_ELVPRIV flag will be
> set for the request in blk_mq_submit_bio(), regardless if the request
> was submitted to a scheduler, or bypassed the scheduler.
> Later, blk_mq_free_request() checks if the RQF_ELVPRIV flag is set,
> if it is, the ops.finish_request callback will be called.
> The problem with this is that the finish_request scheduler callback
> will be called for requests that bypassed the scheduler.
> Fix this by calling the scheduler ops.prepare_request callback, and
> set the RQF_ELVPRIV flag only immediately before calling the insert
> callback.

One request could be inserted more than one times, such as requeue,
however __blk_mq_alloc_request() is just run once, so is it fine to
call ->prepare_request more than one time for same request?

Or I am wondering why not call ->prepare_request when the following
check is true?

	if (e && e->type->ops.prepare_request && !op_is_flush(data->cmd_flags) &&


  reply	other threads:[~2021-08-27 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 12:41 [RFC PATCH 0/2] improve io scheduler callback triggering Niklas Cassel
2021-08-27 12:41 ` [RFC PATCH 1/2] blk-mq: don't call callbacks for requests that bypassed the scheduler Niklas Cassel
2021-08-27 13:28   ` Ming Lei [this message]
2021-08-30  9:48     ` Niklas Cassel
2021-08-30 10:11       ` Ming Lei
2021-09-07 12:59         ` Niklas Cassel
2021-08-27 12:41 ` [RFC PATCH 2/2] Revert "mq-deadline: Fix request accounting" Niklas Cassel

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:

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

  git send-email \
    --in-reply-to=YSjoZ/cul4w2l8tG@T590 \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).