]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - block/blk-cgroup.c
blkcg: make blkcg_gq's hierarchical
authorTejun Heo <tj@kernel.org>
Wed, 9 Jan 2013 16:05:10 +0000 (08:05 -0800)
committerTejun Heo <tj@kernel.org>
Wed, 9 Jan 2013 16:05:10 +0000 (08:05 -0800)
commit3c547865902e9fc30dc15941f326fd8039c6628d
treee86d926e86258cfc69d6665e28551fa14267634e
parent93e6d5d8f5c909479623c6ab4427f038c6c3f63f
blkcg: make blkcg_gq's hierarchical

Currently a child blkg (blkcg_gq) can be created even if its parent
doesn't exist.  ie. Given a blkg, it's not guaranteed that its
ancestors will exist.  This makes it difficult to implement proper
hierarchy support for blkcg policies.

Always create blkgs recursively and make a child blkg hold a reference
to its parent.  blkg->parent is added so that finding the parent is
easy.  blkcg_parent() is also added in the process.

This change can be visible to userland.  e.g. while issuing IO in a
nested cgroup didn't affect the ancestors at all, now it will
initialize all ancestor blkgs and zero stats for the request_queue
will always appear on them.  While this is userland visible, this
shouldn't cause any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
block/blk-cgroup.c
block/blk-cgroup.h