diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-07-16 16:19:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-16 10:11:00 +0200 |
commit | 2b6c7c7c9cfa054a3f77d78a836003c12780d514 (patch) | |
tree | 203cc0a74907c28c55c77968054685cfeb0a6b5a /block | |
parent | a27b56e3233c4ff38ce9f45abd38f659c244a7e8 (diff) | |
download | linux-stable-2b6c7c7c9cfa054a3f77d78a836003c12780d514.tar.gz linux-stable-2b6c7c7c9cfa054a3f77d78a836003c12780d514.tar.bz2 linux-stable-2b6c7c7c9cfa054a3f77d78a836003c12780d514.zip |
rq-qos: don't reset has_sleepers on spurious wakeups
[ 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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-rq-qos.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 659ccb8b693f..e5d75280b431 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -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); } |