Linux block layer
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, David Jeffery <djeffery@redhat.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Keith Busch <kbusch@kernel.org>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] blk-mq: avoid double ->queue_rq() because of early timeout
Date: Wed, 26 Oct 2022 08:21:18 +0800	[thread overview]
Message-ID: <Y1h9fiY8TYD8HK5v@T590> (raw)
In-Reply-To: <bf375891-667f-1bcc-bd63-b90e757f5322@kernel.dk>

On Tue, Oct 25, 2022 at 12:11:39PM -0600, Jens Axboe wrote:
> On 10/24/22 6:55 PM, Ming Lei wrote:
> > @@ -1593,10 +1598,18 @@ static void blk_mq_timeout_work(struct work_struct *work)
> >  	if (!percpu_ref_tryget(&q->q_usage_counter))
> >  		return;
> >  
> > -	blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &next);
> > +	/*
> > +	 * Before walking tags, we must ensure any submit started before
> > +	 * the current time has finished. Since the submit uses srcu or rcu,
> > +	 * wait for a synchronization point to ensure all running submits
> > +	 * have finished
> > +	 */
> > +	blk_mq_wait_quiesce_done(q);
> 
> I'm a little worried about this bit - so we'll basically do a sync RCU
> every time the timeout timer runs... Depending on machine load, that
> can take a long time.

Yeah, the per-queue timeout timer is never canceled after request is
completed, so most of times the timeout work does nothing.

Can we run the sync RCU only if there is timed out request found? Then
the wait is only needed in case that timeout handling is required. Also
sync rcu is already done in some driver's ->timeout().


Thanks,
Ming


  reply	other threads:[~2022-10-26  0:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  0:55 [PATCH] blk-mq: avoid double ->queue_rq() because of early timeout Ming Lei
2022-10-25 13:59 ` David Jeffery
2022-10-25 14:04 ` Bart Van Assche
2022-10-25 18:11 ` Jens Axboe
2022-10-26  0:21   ` Ming Lei [this message]
2022-10-26  0:53     ` Jens Axboe

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=Y1h9fiY8TYD8HK5v@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=djeffery@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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