On 7/31/21 12:21 AM, Yu Kuai wrote: > We run a test that delete and recover devcies frequently(two devices on > the same host), and we found that 'active_queues' is super big after a > period of time. > > If device a and device b share a tag set, and a is deleted, then > blk_mq_exit_queue() will clear BLK_MQ_F_TAG_QUEUE_SHARED because there > is only one queue that are using the tag set. However, if b is still > active, the active_queues of b might never be cleared even if b is > deleted. > > Thus clear active_queues before BLK_MQ_F_TAG_QUEUE_SHARED is cleared. Applied, thanks. -- Jens Axboe