]> git.proxmox.com Git - mirror_ubuntu-disco-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)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 3 Apr 2019 18:12:43 +0000 (13:12 -0500)
commita67e17a54c9af413c328fd4da79e78a9432d5171
treee9730b801c3263d1e02a7bce3d6934faf32ad147
parent8f4e8c69540a44605840521f2f14293dbeacfa6a
blk-mq: fix sbitmap ws_active for shared tags

BugLink: https://bugs.launchpad.net/bugs/1823060
commit e861857545567adec8da3bdff728efdf7db12285 upstream.

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: 5d2ee7122c73 ("sbitmap: optimize wakeup check")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
block/blk-mq.c