]> git.baikalelectronics.ru Git - kernel.git/commit
rq-qos: fix missed wake-ups in rq_qos_throttle
authorJosef Bacik <josef@toxicpanda.com>
Tue, 16 Jul 2019 20:19:26 +0000 (16:19 -0400)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Jul 2019 16:20:13 +0000 (10:20 -0600)
commit46ba3cd1cdcb7c46ffd0a807e2b9d5e77ea2951b
tree60be1aaf6d7be31cf80f44a28d53ff5b3c465487
parent97b08f467b66d5b5ef1125111311ab80014f3894
rq-qos: fix missed wake-ups in rq_qos_throttle

We saw a hang in production with WBT where there was only one waiter in
the throttle path and no outstanding IO.  This is because of the
has_sleepers optimization that is used to make sure we don't steal an
inflight counter for new submitters when there are people already on the
list.

We can race with our check to see if the waitqueue has any waiters (this
is done locklessly) and the time we actually add ourselves to the
waitqueue.  If this happens we'll go to sleep and never be woken up
because nobody is doing IO to wake us up.

Fix this by checking if the waitqueue has a single sleeper on the list
after we add ourselves, that way we have an uptodate view of the list.

Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-rq-qos.c