Thread (25 messages) 25 messages, 5 authors, 2025-08-21

Re: [PATCHv3 2/3] block: decrement block_rq_qos static key in rq_qos_del()

From: Ming Lei <hidden>
Date: 2025-08-14 11:33:41

On Thu, Aug 14, 2025 at 01:54:58PM +0530, Nilay Shroff wrote:
rq_qos_add() increments the block_rq_qos static key when a QoS
policy is attached. When a QoS policy is removed via rq_qos_del(),
we must symmetrically decrement the static key. If this removal drops
the last QoS policy from the queue (q->rq_qos becomes NULL), the
static branch can be disabled and the jump label patched to a NOP,
avoiding overhead on the hot path.

This change ensures rq_qos_add()/rq_qos_del() keep the
block_rq_qos static key balanced and prevents leaving the branch
permanently enabled after the last policy is removed.

Fixes: 033b667a823e ("block: blk-rq-qos: guard rq-qos helpers by static key")
Signed-off-by: Nilay Shroff <redacted>
Reviewed-by: Ming Lei <redacted>

Thanks,
Ming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help