lkml.org 
[lkml]   [2023]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/17] block, bfq: try preemption if bfqq has higher weight and the same priority class
Date
We will compare priority class and weight of current bfqq with
in_service_queue to check if bfqq could preempt in_service_queue.
Currently we will try to preempt in_service_queue if bfqq has higher
weight than in_service_queue even with lower priority class. Actually,
we will only serve bfqq with higher priority class (see
bfq_lookup_next_entity), so bfqq with higher weight and lower priority
class will not be a candidate to preempt in_service_queue.
Compare weight of bfqqs with the same priority in
bfq_bfqq_higher_class_or_weight to make preemption check more reasonable.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/bfq-iosched.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 3f5c740664ce..4868538c9745 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1768,6 +1768,10 @@ static bool bfq_bfqq_higher_class_or_weight(struct bfq_queue *bfqq,
if (bfqq->ioprio_class < in_serv_bfqq->ioprio_class)
return true;

+ /* only try weight comparison with same priority class */
+ if (bfqq->ioprio_class != in_serv_bfqq->ioprio_class)
+ return false;
+
if (in_serv_bfqq->entity.parent == bfqq->entity.parent) {
bfqq_weight = bfqq->entity.weight;
in_serv_weight = in_serv_bfqq->entity.weight;
--
2.30.0
\
 
 \ /
  Last update: 2023-03-27 00:28    [W:0.306 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site