On Mon, Apr 8, 2019 at 11:17 AM jianchao.wang <jianchao.w.wang@xxxxxxxxxx> wrote: > > Hi Ming > > Why not add percpu_ref_tryget/put pair into run queue and requeue work, > or before queue the work ? If following this direction, most of block layer API might need the pair. Also Jens has complained in another thread, the pair may introduce 1.2% performance loss, then we should avoid it in the fast path, such as blk_mq_run_hw_queue(). Given it is required that request queue is alive from kobject view before calling almost every block layer API, this lifetime issue should be addressed easily by moving the hctx free into queue's release handler. > > Then freezing queue could really implement to freeze the queue and there will be > no any queue activity after freeze, including run queue and requeue work. The queue activity is just block layer internal thing, not related with driver, so not a big deal by dealing with freeing hctx resources in release handler. Thanks, Ming Lei