Re: [PATCH V2 1/2] blk-mq: serialize queue quiesce and unquiesce by mutex
From: Sagi Grimberg <sagi@grimberg.me>
Date: 2020-08-26 16:23:35
From: Sagi Grimberg <sagi@grimberg.me>
Date: 2020-08-26 16:23:35
quoted
quoted
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?
We might need it when the async quiesce is implemented for this, because then quiesce will only "start" and in a different context wait for the quiesced event (where we may need to add wakeup for waiters). This is why I want to see this with the async quiesce piece.