aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2010-10-01 08:49:49 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-10-01 08:49:49 -0400
commitfe0714377ee2ca161bf2afb7773e22f15f1786d4 (patch)
tree09f5e8686d741d012333c92251b8cc66793ef916 /block/cfq-iosched.c
parent02977e4af7ed3b478c505e50491ffdf3e1314cf4 (diff)
blkio: Recalculate the throttled bio dispatch time upon throttle limit change
o Currently any cgroup throttle limit changes are processed asynchronousy and the change does not take affect till a new bio is dispatched from same group. o It might happen that a user sets a redicuously low limit on throttling. Say 1 bytes per second on reads. In such cases simple operations like mount a disk can wait for a very long time. o Once bio is throttled, there is no easy way to come out of that wait even if user increases the read limit later. o This patch fixes it. Now if a user changes the cgroup limits, we recalculate the bio dispatch time according to new limits. o Can't take queueu lock under blkcg_lock, hence after the change I wake up the dispatch thread again which recalculates the time. So there are some variables being synchronized across two threads without lock and I had to make use of barriers. Hoping I have used barriers correctly. Any review of memory barrier code especially will help. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 684592621736..86338d5d4d09 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -951,8 +951,8 @@ static inline struct cfq_group *cfqg_of_blkg(struct blkio_group *blkg)
951 return NULL; 951 return NULL;
952} 952}
953 953
954void 954void cfq_update_blkio_group_weight(void *key, struct blkio_group *blkg,
955cfq_update_blkio_group_weight(struct blkio_group *blkg, unsigned int weight) 955 unsigned int weight)
956{ 956{
957 cfqg_of_blkg(blkg)->weight = weight; 957 cfqg_of_blkg(blkg)->weight = weight;
958} 958}