From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "ming.lei@redhat.com" <ming.lei@redhat.com>
Cc: "hch@infradead.org" <hch@infradead.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>
Subject: Re: [PATCH v3 5/9] blk-mq: fix blk_mq_quiesce_queue
Date: Thu, 1 Jun 2017 23:19:11 +0000 [thread overview]
Message-ID: <1496359149.3075.14.camel@sandisk.com> (raw)
In-Reply-To: <20170601022133.GB23563@ming.t460p>
On Thu, 2017-06-01 at 10:21 +0800, Ming Lei wrote:
> On Wed, May 31, 2017 at 03:37:30PM +0000, Bart Van Assche wrote:
> > On Wed, 2017-05-31 at 20:37 +0800, Ming Lei wrote:
> > >=20
> > > + /* wait until queue is unquiesced */
> > > + wait_event_cmd(q->quiesce_wq, !blk_queue_quiesced(q),
> > > + may_sleep ?
> > > + srcu_read_unlock(&hctx->queue_rq_srcu, *srcu_idx) :
> > > + rcu_read_unlock(),
> > > + may_sleep ?
> > > + *srcu_idx =3D srcu_read_lock(&hctx->queue_rq_srcu) :
> > > + rcu_read_lock());
> > > +
> > > if (q->elevator)
> > > goto insert;
> >=20
> > What I see is that in this patch a new waitqueue has been introduced
> > (quiesce_wq) and also that an explanation of why you think this new wai=
tqueue
> > is needed is missing completely. Why is it that you think that the
> > synchronize_scru() and synchronize_rcu() calls in blk_mq_quiesce_queue(=
) are
> > not sufficient? If this new waitqueue is not needed, please remove that
> > waitqueue again.
>=20
> OK, the reason is simple, and it is only related with direct issue.
>=20
> Under this situation, when the queue is quiesced, we have to
>=20
> - insert the current request into sw queue(scheduler queue)
> OR
> -wait until queue becomes unquiesced like what this patch is doing
>=20
> The disadvantage of the 1st way is that we have to consider to run queue
> again in blk_mq_unquiesce_queue() for the queued requests during quiescin=
g.
>=20
> For the 2nd way(what this patch is doing), one benefit is that applicatio=
n
> can avoid to submit I/O to a quiesced queue. Another benefit is that we
> needn't to consider to run queue in blk_mq_unquiesce_queue(). But with co=
st
> of one waitqueue, the cost should be cheap, but if you persist on the 1st
> approach, I am fine to change to that.
Hello Ming,
Since the runtime overhead of the alternative approach (insert into queue) =
is
significantly smaller and since it will result in a simpler implementation =
I
prefer the alternative approach.
Thanks,
Bart.=
next prev parent reply other threads:[~2017-06-01 23:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 12:36 [PATCH v3 0/8] blk-mq: fix & improve queue quiescing Ming Lei
2017-05-31 12:36 ` [PATCH v3 1/9] blk-mq: introduce blk_mq_unquiesce_queue Ming Lei
2017-05-31 12:36 ` [PATCH v3 2/9] block: introduce flag of QUEUE_FLAG_QUIESCED Ming Lei
2017-05-31 12:37 ` [PATCH v3 3/9] blk-mq: use the introduced blk_mq_unquiesce_queue() Ming Lei
2017-05-31 15:21 ` Bart Van Assche
2017-06-01 0:54 ` Ming Lei
2017-06-01 23:09 ` Bart Van Assche
2017-06-02 2:00 ` Ming Lei
2017-06-02 22:19 ` Bart Van Assche
2017-05-31 12:37 ` [PATCH v3 4/9] nvme: host: unquiesce queue in nvme_kill_queues() Ming Lei
2017-05-31 12:37 ` [PATCH v3 5/9] blk-mq: fix blk_mq_quiesce_queue Ming Lei
2017-05-31 15:37 ` Bart Van Assche
2017-06-01 2:21 ` Ming Lei
2017-06-01 23:19 ` Bart Van Assche [this message]
2017-06-02 2:02 ` Ming Lei
2017-05-31 12:37 ` [PATCH v3 6/9] blk-mq: update comments on blk_mq_quiesce_queue() Ming Lei
2017-05-31 12:37 ` [PATCH v3 7/9] blk-mq: don't stop queue for quiescing Ming Lei
2017-05-31 12:37 ` [PATCH v3 8/9] blk-mq: clarify dispatch may not be drained/blocked by stopping queue Ming Lei
2017-05-31 12:37 ` [PATCH v3 9/9] Revert "blk-mq: don't use sync workqueue flushing from drivers" Ming Lei
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=1496359149.3075.14.camel@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.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