> -static void hctx_unlock(struct blk_mq_hw_ctx *hctx, int srcu_idx) > - __releases(hctx->srcu) > +static void hctx_unlock(struct blk_mq_hw_ctx *hctx) > { > if (!(hctx->flags & BLK_MQ_F_BLOCKING)) > rcu_read_unlock(); > else > - srcu_read_unlock(hctx->srcu, srcu_idx); > + percpu_ref_put(&hctx->queue->dispatch_counter); While you're at it: can we avoid the pointless inversion in the if statement and just do: if (hctx->flags & BLK_MQ_F_BLOCKING) percpu_ref_put(&hctx->queue->dispatch_counter); else rcu_read_unlock(); > +static inline bool hctx_lock(struct blk_mq_hw_ctx *hctx) > { > if (!(hctx->flags & BLK_MQ_F_BLOCKING)) { > - /* shut up gcc false positive */ > - *srcu_idx = 0; > rcu_read_lock(); > + return true; > } else > - *srcu_idx = srcu_read_lock(hctx->srcu); > + return percpu_ref_tryget_live(&hctx->queue->dispatch_counter); > } Same here. Otherwise this looks good to me, but did you do a deep audit that all the new hctx_lock() failure cases don't cause problems?