[PATCH 5/5] blk-mq: support nested blk_mq_quiesce_queue()
Ming Lei
ming.lei at redhat.com
Wed Sep 29 08:44:08 PDT 2021
On Wed, Sep 29, 2021 at 02:53:27PM +0300, Sagi Grimberg wrote:
>
>
> On 9/29/21 7:15 AM, Ming Lei wrote:
> > Turns out that blk_mq_freeze_queue() isn't stronger[1] than
> > blk_mq_quiesce_queue() because dispatch may still be in-progress after
> > queue is frozen, and in several cases, such as switching io scheduler,
> > updating nr_requests & wbt latency, we still need to quiesce queue as a
> > supplement of freezing queue.
> >
> > As we need to extend uses of blk_mq_quiesce_queue(), it is inevitable
> > for us to need support nested quiesce, especailly we can't let
> > unquiesce happen when there is quiesce originated from other contexts.
>
> The serialization need is clear, but why is the nesting required?
I guess the serialization is what my nesting meant:
1) code path1:
- quiesce
- do something
- unquiesce
2) code path2:
- quiesce
- do something
- unquiesce
What the patch tries to implement is that the actual unquiesce action has
to be done in the last or outermost unquiesce of the two code paths.
Not sure if serialization is a good term here, maybe I should use words of
concurrent quiesce, or other better one? Nesting is really supported
by this patch, such as code path2 may be part of 'do something' in code
path1. Meantime serialization among quiesce and unquiesce is supported
too.
> In other words what is the harm is running the hw queue every time
> we unquiesce?
running hw queue in each unquiesce doesn't matter, what matters is that
the QUIESCE flag has to be cleared in the outermost or the last unquiesce.
But if QUIESCE isn't set, it isn't useless to run hw queue in unquiesce.
Thanks,
Ming
More information about the Linux-nvme
mailing list