On 7/2/25 6:15 PM, Yu Kuai wrote:
Just a question, blk_mq_quiesce_queue also calls synchronize_rcu() to wait for inflight dispatch work to be done, is it safe in following patches? I think it's not, dispatch work can be running while there is no request pending, menas queue can be frozen with active dispatch work.
No work is dispatched if a queue is frozen because freezing a queue only finishes after q_usage_counter drops to zero. queue_rq() and queue_rqs() are only called if one or more requests are being executed. q_usage_counter is increased when a request is allocated and decreased when a request is freed. Hence, q_usage_counter cannot be zero while queue_rq() or queue_rqs() is in progress. Hence, neither queue_rq() nor queue_rqs() are called while q_usage_counter is zero. Thanks, Bart.