public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: yangerkun <yangerkun@huawei.com>
To: Bart Van Assche <bvanassche@acm.org>, <ming.lei@redhat.com>,
	<damien.lemoal@wdc.com>, <axboe@kernel.dk>,
	<miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>
Cc: <linux-block@vger.kernel.org>, <linux-mtd@lists.infradead.org>,
	<yi.zhang@huawei.com>, <yebin10@huawei.com>, <houtao1@huawei.com>
Subject: Re: [QUESTION] blk_mq_freeze_queue in elevator_init_mq
Date: Wed, 17 Nov 2021 16:39:32 +0800	[thread overview]
Message-ID: <03421fa2-fa48-3452-743b-d9cabefc58df@huawei.com> (raw)
In-Reply-To: <59cb2cfd-3890-9fb4-9e77-a4b084d088e9@acm.org>



On 2021/11/17 12:11, Bart Van Assche wrote:
> On 11/16/21 19:37, yangerkun wrote:
>> This commit add blk_mq_freeze_queue in elevator_init_mq which try to
>> make sure no in-flight request while we go through blk_mq_init_sched.
>> But does there any drivers can leave IO alive while we go through
>> elevator_init_mq? And if no, maybe we can just remove this logical to
>> fix the regression...
> 
> Does this untested patch help? Please note that I'm not recommending to
> integrate this patch in the upstream kernel but if it helps it can be a
> building block of a solution.
> 
> Thanks,
> 
> Bart.
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 3ab34c4f20da..b85dcb72a579 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -167,6 +167,7 @@ void blk_freeze_queue_start(struct request_queue *q)
>           mutex_unlock(&q->mq_freeze_lock);
>           if (queue_is_mq(q))
>               blk_mq_run_hw_queues(q, false);
> +        synchronize_rcu_expedited();
>       } else {
>           mutex_unlock(&q->mq_freeze_lock);
>       }
> .

Sorry for that it's blk_mq_quiesce_queue which actually introduce the 
RCU gap... I have try synchronize_rcu_expedited in blk_mq_quiesce_queue 
which seems useless...

  reply	other threads:[~2021-11-17  8:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  3:37 [QUESTION] blk_mq_freeze_queue in elevator_init_mq yangerkun
2021-11-17  4:11 ` Bart Van Assche
2021-11-17  8:39   ` yangerkun [this message]
2021-11-17  8:06 ` Ming Lei
2021-11-17  8:37   ` yangerkun
2021-11-17  9:00   ` yangerkun
2021-11-17 10:19     ` Ming Lei
2021-11-18 13:12       ` yangerkun

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=03421fa2-fa48-3452-743b-d9cabefc58df@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@wdc.com \
    --cc=houtao1@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=yebin10@huawei.com \
    --cc=yi.zhang@huawei.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