Commit 7b5af5cf authored by Toshiaki Makita's avatar Toshiaki Makita Committed by Jens Axboe

cfq-iosched: Add comments on update timing of weight

Explain that weight has to be updated on activation.
This complements previous fix e15693ef ("cfq-iosched: Fix wrong
children_weight calculation").
Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent e15693ef
...@@ -1272,6 +1272,9 @@ __cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) ...@@ -1272,6 +1272,9 @@ __cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg)
rb_insert_color(&cfqg->rb_node, &st->rb); rb_insert_color(&cfqg->rb_node, &st->rb);
} }
/*
* This has to be called only on activation of cfqg
*/
static void static void
cfq_update_group_weight(struct cfq_group *cfqg) cfq_update_group_weight(struct cfq_group *cfqg)
{ {
...@@ -1303,6 +1306,11 @@ cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) ...@@ -1303,6 +1306,11 @@ cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg)
/* add to the service tree */ /* add to the service tree */
BUG_ON(!RB_EMPTY_NODE(&cfqg->rb_node)); BUG_ON(!RB_EMPTY_NODE(&cfqg->rb_node));
/*
* Update leaf_weight. We cannot update weight at this point
* because cfqg might already have been activated and is
* contributing its current weight to the parent's child_weight.
*/
cfq_update_group_leaf_weight(cfqg); cfq_update_group_leaf_weight(cfqg);
__cfq_group_service_tree_add(st, cfqg); __cfq_group_service_tree_add(st, cfqg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment