cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: Add comments on update timing of weight
@ 2014-08-28  8:14 Toshiaki Makita
       [not found] ` <1409213698-10136-1-git-send-email-makita.toshiaki-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Toshiaki Makita @ 2014-08-28  8:14 UTC (permalink / raw)
  To: Tejun Heo, Jens Axboe
  Cc: Toshiaki Makita, cgroups-u79uwXL29TY76Z2rM5mHXA, Ruki Sekiya,
	Vivek Goyal

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-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
---
 block/cfq-iosched.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d749463..3f31cf9 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)
 	rb_insert_color(&cfqg->rb_node, &st->rb);
 }
 
+/*
+ * This has to be called only on activation of cfqg
+ */
 static void
 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)
 	/* add to the service tree */
 	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_group_service_tree_add(st, cfqg);
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfq-iosched: Add comments on update timing of weight
       [not found] ` <1409213698-10136-1-git-send-email-makita.toshiaki-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
@ 2014-08-28 14:30   ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-08-28 14:30 UTC (permalink / raw)
  To: Toshiaki Makita, Tejun Heo
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, Ruki Sekiya, Vivek Goyal

On 08/28/2014 02:14 AM, Toshiaki Makita wrote:
> Explain that weight has to be updated on activation.
> This complements previous fix e15693ef18e1 ("cfq-iosched: Fix wrong
> children_weight calculation").

Applied, thanks.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-28 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28  8:14 [PATCH] cfq-iosched: Add comments on update timing of weight Toshiaki Makita
     [not found] ` <1409213698-10136-1-git-send-email-makita.toshiaki-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-08-28 14:30   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).