Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e6d0000 authored by Paolo Valente's avatar Paolo Valente Committed by Razziell
Browse files

block/bfq: Add extra checks related to entity scheduling



- extra checks related to ioprioi-class changes
- specific check on st->idle in __bfq_requeue_entity

Change-Id: I86655f1a9c0400d8d329bedc148907a10d40cdda
Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
Signed-off-by: default avatarFAROVITUS <farovitus@gmail.com>
Signed-off-by: default avatarAlbert I <krascgq@outlook.co.id>
parent 38d7c6f4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -812,6 +812,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
		}
#endif

		BUG_ON(entity->tree && update_class_too);
		BUG_ON(old_st->wsum < entity->weight);
		old_st->wsum -= entity->weight;

@@ -883,9 +884,11 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,

		new_st->wsum += entity->weight;

		if (new_st != old_st)
		if (new_st != old_st) {
			BUG_ON(!update_class_too);
			entity->start = new_st->vtime;
		}
	}

	return new_st;
}
@@ -993,6 +996,7 @@ static void bfq_update_fin_time_enqueue(struct bfq_entity *entity,
	 * tree, then it is safe to invoke next function with the last
	 * parameter set (see the comments on the function).
	 */
	BUG_ON(entity->tree);
	st = __bfq_entity_update_weight_prio(st, entity, true);
	bfq_calc_finish(entity, entity->budget);

@@ -1113,9 +1117,11 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
		 * check for that.
		 */
		bfq_idle_extract(st, entity);
		BUG_ON(entity->tree);
		entity->start = bfq_gt(min_vstart, entity->finish) ?
			min_vstart : entity->finish;
	} else {
		BUG_ON(entity->tree);
		/*
		 * The finish time of the entity may be invalid, and
		 * it is in the past for sure, otherwise the queue
@@ -1203,6 +1209,7 @@ static void __bfq_requeue_entity(struct bfq_entity *entity)
		 */
		bfq_calc_finish(entity, entity->service);
		entity->start = entity->finish;
		BUG_ON(entity->tree && entity->tree == &st->idle);
		BUG_ON(entity->tree && entity->tree != &st->active);
		/*
		 * In addition, if the entity had more than one child