Skip to content

blk-mq: fix dispatch waiter accounting for reserved tags

huhai linux-block 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sbitmap: add __sbitmap_add_wait_queue()include/linux/sbitmap.h lib/sbitmap.c+27 -50 replies
2/2blk-mq: fix dispatch waiter accounting for reserved tagsblock/blk-mq.c include/linux/blk-mq.h+14 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] blk-mq: fix dispatch waiter accounting for reserved tags

From: Henry Hu <[email protected]>

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

Signature · 1 line
2.40.1