On Fri, Mar 22, 2019 at 04:01:16PM +0100, Peter Zijlstra wrote: > On Fri, Mar 22, 2019 at 10:48:17PM +0800, Yufen Yu wrote: > > @@ -2710,7 +2710,7 @@ static struct blk_mq_hw_ctx *blk_mq_alloc_and_init_hctx( > > return NULL; > > } > > > > - atomic_set(&hctx->nr_active, 0); > > + refcount_set(&hctx->nr_active, 0); > > hctx->numa_node = node; > > hctx->queue_num = hctx_idx; > > > > That looks bogus, refcount_t cannot inc-from-zero. I also don't see a single dec_and_test in that patch, which leads me to believe nr_active is not in fact a refcount.