Linux block layer
 help / color / mirror / Atom feed
* [PATCH 0/2] blk-mq: fix dispatch waiter accounting for reserved tags
@ 2026-09-20 10:11 huhai
  2026-09-20 10:11 ` [PATCH 1/2] sbitmap: add __sbitmap_add_wait_queue() huhai
  2026-09-20 10:11 ` [PATCH 2/2] blk-mq: fix dispatch waiter accounting for reserved tags huhai
  0 siblings, 2 replies; 3+ messages in thread
From: huhai @ 2026-09-20 10:11 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, shikemeng, Henry Hu

From: Henry Hu <huhai@kylinos.cn>

blk_mq_mark_tag_wait() may queue hctx->dispatch_wait on breserved_tags
and increment that queue's ws_active. The wakeup path always decrements
bitmap_tags.ws_active, though. So the reserved counter stays elevated
and the regular counter can be decremented without a matching
increment, which may cause later wakeups to be skipped.

This is reachable and commit 98b99e9412d0 made the waiter side pick the
right queue but left the wakeup side hardcoded to bitmap_tags.

Henry Hu (2):
  sbitmap: add __sbitmap_add_wait_queue()
  blk-mq: fix dispatch waiter accounting for reserved tags

 block/blk-mq.c          | 33 +++++++++++++--------------------
 include/linux/blk-mq.h  |  2 +-
 include/linux/sbitmap.h |  9 ++++++++-
 lib/sbitmap.c           | 23 +++++++++++++++++++----
 4 files changed, 41 insertions(+), 26 deletions(-)


base-commit: 3f2425f5b5bbbdd991ca9cdfd5502e68d8895998
-- 
2.40.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-20 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-20 10:11 [PATCH 0/2] blk-mq: fix dispatch waiter accounting for reserved tags huhai
2026-09-20 10:11 ` [PATCH 1/2] sbitmap: add __sbitmap_add_wait_queue() huhai
2026-09-20 10:11 ` [PATCH 2/2] blk-mq: fix dispatch waiter accounting for reserved tags huhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox