diff options
authorTejun Heo2012-03-05 15:15:20 -0600
committerJens Axboe2012-03-06 14:27:23 -0600
commite8989fae38d9831c72b20375a206a919ca468c52 (patch)
tree2eeb1320e526cd0ba187465c0e6e19799dc1b956 /block/blk-sysfs.c
parent03aa264ac15637b6f98374270bcdf31400965505 (diff)
blkcg: unify blkg's for blkcg policies
Currently, blkg is per cgroup-queue-policy combination. This is unnatural and leads to various convolutions in partially used duplicate fields in blkg, config / stat access, and general management of blkgs. This patch make blkg's per cgroup-queue and let them serve all policies. blkgs are now created and destroyed by blkcg core proper. This will allow further consolidation of common management logic into blkcg core and API with better defined semantics and layering. As a transitional step to untangle blkg management, elvswitch and policy [de]registration, all blkgs except the root blkg are being shot down during elvswitch and bypass. This patch adds blkg_root_update() to update root blkg in place on policy change. This is hacky and racy but should be good enough as interim step until we get locking simplified and switch over to proper in-place update for all blkgs. -v2: Root blkgs need to be updated on elvswitch too and blkg_alloc() comment wasn't updated according to the function change. Fixed. Both pointed out by Vivek. -v3: v2 updated blkg_destroy_all() to invoke update_root_blkg_pd() for all policies. This freed root pd during elvswitch before the last queue finished exiting and led to oops. Directly invoke update_root_blkg_pd() only on BLKIO_POLICY_PROP from cfq_exit_queue(). This also is closer to what will be done with proper in-place blkg update. Reported by Vivek. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-sysfs.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 00cdc987b52..aa41b47c22d 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -480,6 +480,8 @@ static void blk_release_queue(struct kobject *kobj)
480 480
481 blk_sync_queue(q); 481 blk_sync_queue(q);
482 482
483 blkcg_exit_queue(q);
483 if (q->elevator) { 485 if (q->elevator) {
484 spin_lock_irq(q->queue_lock); 486 spin_lock_irq(q->queue_lock);
485 ioc_clear_queue(q); 487 ioc_clear_queue(q);
@@ -487,8 +489,6 @@ static void blk_release_queue(struct kobject *kobj)
487 elevator_exit(q->elevator); 489 elevator_exit(q->elevator);
488 } 490 }
489 491
490 blkcg_exit_queue(q);
492 if (rl->rq_pool) 492 if (rl->rq_pool)
493 mempool_destroy(rl->rq_pool); 493 mempool_destroy(rl->rq_pool);
494 494