]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix sbitmap ws_active for shared tags
authorJens Axboe <axboe@kernel.dk>
Mon, 25 Mar 2019 18:34:10 +0000 (12:34 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Mar 2019 19:05:47 +0000 (13:05 -0600)
commit7de11bdecdbf99ee40950f185b16d007695ac3f2
tree71572b52d87ba2421159bf6ee70c85708878be44
parent7a37fce98ef13b8189b45127e82f3ca539ba6284
blk-mq: fix sbitmap ws_active for shared tags

We now wrap sbitmap waitqueues in an active counter, so we can avoid
iterating wakeups unless we have waiters there. This works as long as
everyone that's manipulating the waitqueues use the proper helpers. For
the tag wait case for shared tags, however, we add ourselves to the
waitqueue without incrementing/decrementing the ->ws_active count. This
means that wakeups can take a long time to happen.

Fix this by manually doing the inc/dec as needed for the wait queue
handling.

Reported-by: Michael Leun <kbug@newton.leun.net>
Tested-by: Michael Leun <kbug@newton.leun.net>
Cc: stable@vger.kernel.org
Reviewed-by: Omar Sandoval <osandov@fb.com>
Fixes: 81b9d7fe7a45 ("sbitmap: optimize wakeup check")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c