Skip to content

Commit 33a16a9

Browse files
Algodev-githubaxboe
authored andcommitted
block, bfq: extend incomplete name of field on_st
The flag on_st in the bfq_entity data structure is true if the entity is on a service tree or is in service. Yet the name of the field, confusingly, does not mention the second, very important case. Extend the name to mention the second case too. Tested-by: Oleksandr Natalenko <[email protected]> Signed-off-by: Paolo Valente <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent ecedd3d commit 33a16a9

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

block/bfq-cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
659659

660660
if (bfq_bfqq_busy(bfqq))
661661
bfq_deactivate_bfqq(bfqd, bfqq, false, false);
662-
else if (entity->on_st)
662+
else if (entity->on_st_or_in_serv)
663663
bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);
664664
bfqg_and_blkg_put(bfqq_group(bfqq));
665665

block/bfq-iosched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ bfq_bfqq_resume_state(struct bfq_queue *bfqq, struct bfq_data *bfqd,
10591059

10601060
static int bfqq_process_refs(struct bfq_queue *bfqq)
10611061
{
1062-
return bfqq->ref - bfqq->allocated - bfqq->entity.on_st -
1062+
return bfqq->ref - bfqq->allocated - bfqq->entity.on_st_or_in_serv -
10631063
(bfqq->weight_counter != NULL);
10641064
}
10651065

block/bfq-iosched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ struct bfq_entity {
150150
* Flag, true if the entity is on a tree (either the active or
151151
* the idle one of its service_tree) or is in service.
152152
*/
153-
bool on_st;
153+
bool on_st_or_in_serv;
154154

155155
/* B-WF2Q+ start and finish timestamps [sectors/weight] */
156156
u64 start, finish;

block/bfq-wf2q.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void bfq_forget_entity(struct bfq_service_tree *st,
645645
{
646646
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
647647

648-
entity->on_st = false;
648+
entity->on_st_or_in_serv = false;
649649
st->wsum -= entity->weight;
650650
if (bfqq && !is_in_service)
651651
bfq_put_queue(bfqq);
@@ -999,7 +999,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
999999
*/
10001000
bfq_get_entity(entity);
10011001

1002-
entity->on_st = true;
1002+
entity->on_st_or_in_serv = true;
10031003
}
10041004

10051005
#ifdef CONFIG_BFQ_GROUP_IOSCHED
@@ -1165,7 +1165,10 @@ bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree)
11651165
struct bfq_service_tree *st;
11661166
bool is_in_service;
11671167

1168-
if (!entity->on_st) /* entity never activated, or already inactive */
1168+
if (!entity->on_st_or_in_serv) /*
1169+
* entity never activated, or
1170+
* already inactive
1171+
*/
11691172
return false;
11701173

11711174
/*
@@ -1620,7 +1623,7 @@ bool __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)
16201623
* service tree either, then release the service reference to
16211624
* the queue it represents (taken with bfq_get_entity).
16221625
*/
1623-
if (!in_serv_entity->on_st) {
1626+
if (!in_serv_entity->on_st_or_in_serv) {
16241627
/*
16251628
* If no process is referencing in_serv_bfqq any
16261629
* longer, then the service reference may be the only

0 commit comments

Comments
 (0)