diff mbox series

[4/4] rq-qos: don't reset has_sleepers on spurious wakeups

Message ID 20190715201120.72749-5-josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series rq-qos memory barrier shenanigans | expand

Commit Message

Josef Bacik July 15, 2019, 8:11 p.m. UTC
If we had multiple sleepers before we don't need to worry about never
being woken up.  If we're woken up randomly without having gotten our
inflight token then we need to go back to sleep, we won't be properly
woken up without being given our inflight token anyway so this resetting
isn't needed.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 block/blk-rq-qos.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Oleg Nesterov July 16, 2019, 8:35 a.m. UTC | #1
On 07/15, Josef Bacik wrote:
>
> If we had multiple sleepers before we don't need to worry about never
> being woken up.  If we're woken up randomly without having gotten our
> inflight token then we need to go back to sleep, we won't be properly
> woken up without being given our inflight token anyway so this resetting
> isn't needed.

Yes, and this means that we can avoid acquire_inflight_cb() if e're woken
up randomly, so

> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  block/blk-rq-qos.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
> index f4aa7b818cf5..35bc6f54d088 100644
> --- a/block/blk-rq-qos.c
> +++ b/block/blk-rq-qos.c
> @@ -261,7 +261,6 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
>  			break;
>  		}
>  		io_schedule();
> -		has_sleeper = false;

I still think it should do

		has_sleeper = true;

Oleg.
diff mbox series

Patch

diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index f4aa7b818cf5..35bc6f54d088 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -261,7 +261,6 @@  void rq_qos_wait(struct rq_wait *rqw, void *private_data,
 			break;
 		}
 		io_schedule();
-		has_sleeper = false;
 	} while (1);
 	finish_wait(&rqw->wait, &data.wq);
 }