From: Ming Lei <ming.lei@redhat.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Chao Leng <lengchao@huawei.com>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Sagi Grimberg <sagi@grimberg.me>,
Bart Van Assche <bvanassche@acm.org>,
Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH V2 1/2] blk-mq: serialize queue quiesce and unquiesce by mutex
Date: Thu, 27 Aug 2020 10:38:44 +0800 [thread overview]
Message-ID: <20200827023844.GA129685@T590> (raw)
In-Reply-To: <20200826153633.GA2151118@dhcp-10-100-145-180.wdl.wdc.com>
On Wed, Aug 26, 2020 at 08:36:33AM -0700, Keith Busch wrote:
> On Wed, Aug 26, 2020 at 04:54:22PM +0800, Ming Lei wrote:
> > On Wed, Aug 26, 2020 at 03:51:25PM +0800, Chao Leng wrote:
> > > It doesn't matter. Because the reentry of quiesce&unquiesce queue is not
> > > safe, must be avoided by other mechanism. otherwise, exceptions may
> > > occur. Introduce mq_quiesce_lock looks saving possible synchronization
> > > waits, but it should not happen. If really happen, we need fix it.
> >
> > Sagi mentioned there may be nested queue quiesce, so I add .mq_quiesce_lock
> > to make this usage easy to support, meantime avoid percpu_ref warning
> > in such usage.
> >
> > Anyway, not see any problem with adding .mq_quiesce_lock, so I'd suggest to
> > move on with this way.
>
> I'm not sure there really are any nested queue quiesce paths, but if
> there are, wouldn't we need to track the "depth" like how a queue freeze
> works?
Both atomic 'depth' and .mq_quiesce_lock can work for nested queue
quiesce since we can avoid unnecessary queue quiesce with the mutex.
percpu_ref_kill() / percpu_ref_kill_and_confirm() can warn if the
percpu_ref has been killed, that is why I think Sagi's suggestion is good.
But 'depth' may cause trouble easily, such as unbalanced quiesce/unquiesce,
however no such issue with mutex, at least we don't require the two to
be paired strictly so far.
Thanks,
Ming
next prev parent reply other threads:[~2020-08-27 2:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 14:17 [PATCH V2 0/2] blk-mq: implement queue quiesce via percpu_ref for BLK_MQ_F_BLOCKING Ming Lei
2020-08-25 14:17 ` [PATCH V2 1/2] blk-mq: serialize queue quiesce and unquiesce by mutex Ming Lei
2020-08-26 7:51 ` Chao Leng
2020-08-26 8:54 ` Ming Lei
2020-08-26 15:36 ` Keith Busch
2020-08-26 16:23 ` Sagi Grimberg
2020-08-27 2:38 ` Ming Lei [this message]
2020-08-25 14:17 ` [PATCH V2 2/2] blk-mq: implement queue quiesce via percpu_ref for BLK_MQ_F_BLOCKING Ming Lei
2020-09-02 3:11 ` [PATCH V2 0/2] " Ming Lei
2020-09-02 17:52 ` Jens Axboe
2020-09-02 18:20 ` Sagi Grimberg
2020-09-03 0:41 ` Ming Lei
2020-09-03 0:35 ` Ming Lei
2020-09-03 12:37 ` Keith Busch
2020-09-03 13:10 ` 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=20200827023844.GA129685@T590 \
--to=ming.lei@redhat.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=kbusch@kernel.org \
--cc=lengchao@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=sagi@grimberg.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.