]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
rq-qos: don't reset has_sleepers on spurious wakeups
authorJosef Bacik <josef@toxicpanda.com>
Tue, 16 Jul 2019 20:19:27 +0000 (16:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:11:00 +0000 (10:11 +0200)
[ Upstream commit 64e7ea875ef63b2801be7954cf7257d1bfccc266 ]

If we raced with somebody else getting an inflight counter we could fail
to get an inflight counter with no sleepers on the list, and thus need
to go to sleep.  In this case has_sleepers should be true because we are
now relying on the waker to get our inflight counter for us.  And in the
case of spurious wakeups we'd still want this to be the case.  So set
has_sleepers to true if we went to sleep to make sure we're woken up the
proper way.

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

index 659ccb8b693fa63cedfc53536589f5afcf3b1afc..e5d75280b431ea6700ae8be9f54e98f912e22073 100644 (file)
@@ -260,7 +260,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
                        break;
                }
                io_schedule();
-               has_sleeper = false;
+               has_sleeper = true;
        } while (1);
        finish_wait(&rqw->wait, &data.wq);
 }