aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/sbitmap.h
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2022-09-09 11:40:22 -0700
committerJens Axboe <axboe@kernel.dk>2022-09-12 00:10:34 -0600
commit4acb83417cadfdcbe64215f9d0ddcf3132af808e (patch)
tree45bdd14acf29ddc9b49cbb26e30323446d4aaeb6 /include/linux/sbitmap.h
parentsbitmap: Use atomic_long_try_cmpxchg in __sbitmap_queue_get_batch (diff)
downloadwireguard-linux-4acb83417cadfdcbe64215f9d0ddcf3132af808e.tar.xz
wireguard-linux-4acb83417cadfdcbe64215f9d0ddcf3132af808e.zip
sbitmap: fix batched wait_cnt accounting
Batched completions can clear multiple bits, but we're only decrementing the wait_cnt by one each time. This can cause waiters to never be woken, stalling IO. Use the batched count instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215679 Signed-off-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20220909184022.1709476-1-kbusch@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/sbitmap.h')
-rw-r--r--include/linux/sbitmap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h
index 8f5a86e210b9..4d2d5205ab58 100644
--- a/include/linux/sbitmap.h
+++ b/include/linux/sbitmap.h
@@ -575,8 +575,9 @@ void sbitmap_queue_wake_all(struct sbitmap_queue *sbq);
* sbitmap_queue_wake_up() - Wake up some of waiters in one waitqueue
* on a &struct sbitmap_queue.
* @sbq: Bitmap queue to wake up.
+ * @nr: Number of bits cleared.
*/
-void sbitmap_queue_wake_up(struct sbitmap_queue *sbq);
+void sbitmap_queue_wake_up(struct sbitmap_queue *sbq, int nr);
/**
* sbitmap_queue_show() - Dump &struct sbitmap_queue information to a &struct