rq-qos: set ourself TASK_UNINTERRUPTIBLE after we schedule
authorJosef Bacik <josef@toxicpanda.com>
Tue, 16 Jul 2019 20:19:28 +0000 (16:19 -0400)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Jul 2019 16:20:13 +0000 (10:20 -0600)
In case we get a spurious wakeup we need to make sure to re-set
ourselves to TASK_UNINTERRUPTIBLE so we don't busy wait.

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

index 69a0f0b..c450b89 100644 (file)
@@ -262,6 +262,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
                }
                io_schedule();
                has_sleeper = true;
+               set_current_state(TASK_UNINTERRUPTIBLE);
        } while (1);
        finish_wait(&rqw->wait, &data.wq);
 }