From: Ming Lei <ming.lei@redhat.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Lai Jiangshan <jiangshanlai@gmail.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Sagi Grimberg <sagi@grimberg.me>,
Bart Van Assche <bvanassche@acm.org>,
Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Chao Leng <lengchao@huawei.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2 0/2] blk-mq: implement queue quiesce via percpu_ref for BLK_MQ_F_BLOCKING
Date: Thu, 3 Sep 2020 21:10:44 +0800 [thread overview]
Message-ID: <20200903131044.GA786177@T590> (raw)
In-Reply-To: <20200903123702.GA2928425@dhcp-10-100-145-180.wdl.wdc.com>
On Thu, Sep 03, 2020 at 05:37:02AM -0700, Keith Busch wrote:
> On Thu, Sep 03, 2020 at 08:35:45AM +0800, Ming Lei wrote:
> > On Wed, Sep 02, 2020 at 11:52:59AM -0600, Jens Axboe wrote:
> > > On 9/1/20 9:11 PM, Ming Lei wrote:
> > > > On Tue, Aug 25, 2020 at 10:17:32PM +0800, Ming Lei wrote:
> > > >> Hi Jens,
> > > >>
> > > >> The 1st patch add .mq_quiesce_mutex for serializing quiesce/unquiesce,
> > > >> and prepares for replacing srcu with percpu_ref.
> > > >>
> > > >> The 2nd patch replaces srcu with percpu_ref.
> > > >>
> > > >> V2:
> > > >> - add .mq_quiesce_lock
> > > >> - add comment on patch 2 wrt. handling hctx_lock() failure
> > > >> - trivial patch style change
> > > >>
> > > >>
> > > >> Ming Lei (2):
> > > >> blk-mq: serialize queue quiesce and unquiesce by mutex
> > > >> blk-mq: implement queue quiesce via percpu_ref for BLK_MQ_F_BLOCKING
> > > >>
> > > >> block/blk-core.c | 2 +
> > > >> block/blk-mq-sysfs.c | 2 -
> > > >> block/blk-mq.c | 125 +++++++++++++++++++++++------------------
> > > >> block/blk-sysfs.c | 6 +-
> > > >> include/linux/blk-mq.h | 7 ---
> > > >> include/linux/blkdev.h | 6 ++
> > > >> 6 files changed, 82 insertions(+), 66 deletions(-)
> > > >>
> > > >> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> > > >> Cc: Paul E. McKenney <paulmck@kernel.org>
> > > >> Cc: Josh Triplett <josh@joshtriplett.org>
> > > >> Cc: Sagi Grimberg <sagi@grimberg.me>
> > > >> Cc: Bart Van Assche <bvanassche@acm.org>
> > > >> Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
> > > >> Cc: Chao Leng <lengchao@huawei.com>
> > > >> Cc: Christoph Hellwig <hch@lst.de>
> > > >
> > > > Hello Guys,
> > > >
> > > > Is there any objections on the two patches? If not, I'd suggest to move> on.
> > >
> > > Seems like the nested case is one that should either be handled, or at
> > > least detected.
> >
> > Yeah, the 1st patch adds mutex for handling nested case correctly and efficiently.
>
> That doesn't really do anything about handling nested quiesce/unquiesce.
The mutex is required for avoiding warning in percpu_ref_kill_and_confirm() if
two queue quiesce are nested, and I will comment on this motivation in next
version.
> It just prevents two threads from doing it at the same time, but anyone
> can still undo the other's expected queue state. The following on top of
Right, the patch itself changes nothing wrt. this point, and it breaks nothing
too.
> your series will at least detect the condition:
>
> ---
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index ef6c6fa8dab0..52b53f2bb567 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -249,6 +249,7 @@ void blk_mq_unquiesce_queue(struct request_queue *q)
> {
> mutex_lock(&q->mq_quiesce_lock);
>
> + WARN_ON(!blk_queue_quiesced(q));
We can't do that simply, because queue unquiesce may be called
unconditionally on un-quiesced queue, such as nvme_dev_remove_admin(),
nvme_set_queue_dying(), ...
Thanks,
Ming
prev parent reply other threads:[~2020-09-03 14:25 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
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 [this message]
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=20200903131044.GA786177@T590 \
--to=ming.lei@redhat.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kbusch@kernel.org \
--cc=lengchao@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=paulmck@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.