diff options
author | Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> | 2014-08-28 04:14:58 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-08-28 10:16:29 -0400 |
commit | 7b5af5cffce569298b1d03af1ddf1dc43570ab42 (patch) | |
tree | 5dde60d7c4ff816ffd8cb2c48207f7d770718ef8 /block | |
parent | e15693ef18e13e3e6bffe891fe140f18b8ff6d07 (diff) |
cfq-iosched: Add comments on update timing of weight
Explain that weight has to be updated on activation.
This complements previous fix e15693ef18e1 ("cfq-iosched: Fix wrong
children_weight calculation").
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index d7494637c5db..3f31cf9508e6 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1272,6 +1272,9 @@ __cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) | |||
1272 | rb_insert_color(&cfqg->rb_node, &st->rb); | 1272 | rb_insert_color(&cfqg->rb_node, &st->rb); |
1273 | } | 1273 | } |
1274 | 1274 | ||
1275 | /* | ||
1276 | * This has to be called only on activation of cfqg | ||
1277 | */ | ||
1275 | static void | 1278 | static void |
1276 | cfq_update_group_weight(struct cfq_group *cfqg) | 1279 | cfq_update_group_weight(struct cfq_group *cfqg) |
1277 | { | 1280 | { |
@@ -1303,6 +1306,11 @@ cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) | |||
1303 | /* add to the service tree */ | 1306 | /* add to the service tree */ |
1304 | BUG_ON(!RB_EMPTY_NODE(&cfqg->rb_node)); | 1307 | BUG_ON(!RB_EMPTY_NODE(&cfqg->rb_node)); |
1305 | 1308 | ||
1309 | /* | ||
1310 | * Update leaf_weight. We cannot update weight at this point | ||
1311 | * because cfqg might already have been activated and is | ||
1312 | * contributing its current weight to the parent's child_weight. | ||
1313 | */ | ||
1306 | cfq_update_group_leaf_weight(cfqg); | 1314 | cfq_update_group_leaf_weight(cfqg); |
1307 | __cfq_group_service_tree_add(st, cfqg); | 1315 | __cfq_group_service_tree_add(st, cfqg); |
1308 | 1316 | ||