Skip to content

Commit

Permalink
rq-qos: don't reset has_sleepers on spurious wakeups
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
josefbacik authored and axboe committed Jul 18, 2019
1 parent 545fbd0 commit 64e7ea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-rq-qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,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);
}
Expand Down

0 comments on commit 64e7ea8

Please sign in to comment.