aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
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/blk-cgroup.h
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/blk-cgroup.h')
-rw-r--r--block/blk-cgroup.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 2070053a30b1..034c35562dba 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -186,16 +186,17 @@ extern unsigned int blkcg_get_write_iops(struct blkio_cgroup *blkcg,
186 dev_t dev); 186 dev_t dev);
187 187
188typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); 188typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
189typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, 189
190 unsigned int weight); 190typedef void (blkio_update_group_weight_fn) (void *key,
191typedef void (blkio_update_group_read_bps_fn) (struct blkio_group *blkg, 191 struct blkio_group *blkg, unsigned int weight);
192 u64 read_bps); 192typedef void (blkio_update_group_read_bps_fn) (void * key,
193typedef void (blkio_update_group_write_bps_fn) (struct blkio_group *blkg, 193 struct blkio_group *blkg, u64 read_bps);
194 u64 write_bps); 194typedef void (blkio_update_group_write_bps_fn) (void *key,
195typedef void (blkio_update_group_read_iops_fn) (struct blkio_group *blkg, 195 struct blkio_group *blkg, u64 write_bps);
196 unsigned int read_iops); 196typedef void (blkio_update_group_read_iops_fn) (void *key,
197typedef void (blkio_update_group_write_iops_fn) (struct blkio_group *blkg, 197 struct blkio_group *blkg, unsigned int read_iops);
198 unsigned int write_iops); 198typedef void (blkio_update_group_write_iops_fn) (void *key,
199 struct blkio_group *blkg, unsigned int write_iops);
199 200
200struct blkio_policy_ops { 201struct blkio_policy_ops {
201 blkio_unlink_group_fn *blkio_unlink_group_fn; 202 blkio_unlink_group_fn *blkio_unlink_group_fn;