On 18/3/5 04:23, Tejun Heo wrote: > Hello, Joseph. > > Sorry about late reply. > > On Wed, Feb 28, 2018 at 02:52:10PM +0800, Joseph Qi wrote: >> In current code, I'm afraid pd_offline_fn() as well as the rest >> destruction have to be called together under the same blkcg->lock and >> q->queue_lock. >> For example, if we split the pd_offline_fn() and radix_tree_delete() >> into 2 phases, it may introduce a race between blkcg_deactivate_policy() >> when exit queue and blkcg_css_free(), which will result in >> pd_offline_fn() to be called twice. > > So, yeah, the sync scheme aroung blkg is pretty brittle and we'd need > some restructuring to separate out blkg offlining and release, but it > looks like that'd be the right thing to do, no? > Agree, except the restriction above, as of now I don't find any more. I'll try to fix in the way you suggested and post v3. Thanks, Joseph