bfq-wf2q.c (415812f2d6b856d33ede9bf4a2b95575dbbb3d4e) | bfq-wf2q.c (a66c38a171ed25488debf80247a9e72e1026e82c) |
---|---|
1/* 2 * Hierarchical Budget Worst-case Fair Weighted Fair Queueing 3 * (B-WF2Q+): hierarchical scheduling algorithm by which the BFQ I/O 4 * scheduler schedules generic entities. The latter can represent 5 * either single bfq queues (associated with processes) or groups of 6 * bfq queues (associated with cgroups). 7 * 8 * This program is free software; you can redistribute it and/or --- 1100 unchanged lines hidden (view full) --- 1109 * Deactivates an entity, independently from its previous state. Must 1110 * be invoked only if entity is on a service tree. Extracts the entity 1111 * from that tree, and if necessary and allowed, puts it on the idle 1112 * tree. 1113 */ 1114bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree) 1115{ 1116 struct bfq_sched_data *sd = entity->sched_data; | 1/* 2 * Hierarchical Budget Worst-case Fair Weighted Fair Queueing 3 * (B-WF2Q+): hierarchical scheduling algorithm by which the BFQ I/O 4 * scheduler schedules generic entities. The latter can represent 5 * either single bfq queues (associated with processes) or groups of 6 * bfq queues (associated with cgroups). 7 * 8 * This program is free software; you can redistribute it and/or --- 1100 unchanged lines hidden (view full) --- 1109 * Deactivates an entity, independently from its previous state. Must 1110 * be invoked only if entity is on a service tree. Extracts the entity 1111 * from that tree, and if necessary and allowed, puts it on the idle 1112 * tree. 1113 */ 1114bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree) 1115{ 1116 struct bfq_sched_data *sd = entity->sched_data; |
1117 struct bfq_service_tree *st = bfq_entity_service_tree(entity); 1118 int is_in_service = entity == sd->in_service_entity; | 1117 struct bfq_service_tree *st; 1118 bool is_in_service; |
1119 1120 if (!entity->on_st) /* entity never activated, or already inactive */ 1121 return false; 1122 | 1119 1120 if (!entity->on_st) /* entity never activated, or already inactive */ 1121 return false; 1122 |
1123 /* 1124 * If we get here, then entity is active, which implies that 1125 * bfq_group_set_parent has already been invoked for the group 1126 * represented by entity. Therefore, the field 1127 * entity->sched_data has been set, and we can safely use it. 1128 */ 1129 st = bfq_entity_service_tree(entity); 1130 is_in_service = entity == sd->in_service_entity; 1131 |
|
1123 if (is_in_service) 1124 bfq_calc_finish(entity, entity->service); 1125 1126 if (entity->tree == &st->active) 1127 bfq_active_extract(st, entity); 1128 else if (!is_in_service && entity->tree == &st->idle) 1129 bfq_idle_extract(st, entity); 1130 --- 486 unchanged lines hidden --- | 1132 if (is_in_service) 1133 bfq_calc_finish(entity, entity->service); 1134 1135 if (entity->tree == &st->active) 1136 bfq_active_extract(st, entity); 1137 else if (!is_in_service && entity->tree == &st->idle) 1138 bfq_idle_extract(st, entity); 1139 --- 486 unchanged lines hidden --- |