[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvz-devel
Subject:    [Devel] [PATCH RH7 10/12] rq-qos: don't reset has_sleepers on spurious wakeups
From:       Pavel Tikhomirov <ptikhomirov () virtuozzo ! com>
Date:       2022-09-29 11:30:10
Message-ID: 20220929113012.286234-11-ptikhomirov () virtuozzo ! com
[Download RAW message or body]

From: Josef Bacik <josef@toxicpanda.com>

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>

Changes when porting to vz7:
- original patch is patching block/blk-rq-qos.c:rq_qos_wait, but in vz7
  similar hunk is in block/blk-wbt.c:__wbt_wait

https://jira.sw.ru/browse/PSBM-141883
(cherry picked from commit 64e7ea875ef63b2801be7954cf7257d1bfccc266)
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 block/blk-wbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index 5477c3ffe7a7..f3c0841f009a 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -598,7 +598,7 @@ static void __wbt_wait(struct rq_wb *rwb, enum wbt_flags wb_acct,
 		if (lock)
 			spin_lock_irq(lock);
 
-		has_sleeper = false;
+		has_sleeper = true;
 	} while (1);
 
 	finish_wait(&rqw->wait, &data.wq);
-- 
2.37.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic