]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/cfq-iosched.c
cfq-iosched: enable full blkcg hierarchy support
authorTejun Heo <tj@kernel.org>
Wed, 9 Jan 2013 16:05:11 +0000 (08:05 -0800)
committerTejun Heo <tj@kernel.org>
Wed, 9 Jan 2013 16:05:11 +0000 (08:05 -0800)
commitd02f7aa8dce8166dbbc515ce393912aa45e6b8a6
tree8a3e8e54bed797bb084a83008ca47065a261a9d6
parent41cad6ab2cb9ccb3b11546ad56b8b285e47c6279
cfq-iosched: enable full blkcg hierarchy support

With the previous two patches, all cfqg scheduling decisions are based
on vfraction and ready for hierarchy support.  The only thing which
keeps the behavior flat is cfqg_flat_parent() which makes vfraction
calculation consider all non-root cfqgs children of the root cfqg.

Replace it with cfqg_parent() which returns the real parent.  This
enables full blkcg hierarchy support for cfq-iosched.  For example,
consider the following hierarchy.

        root
      /      \
   A:500      B:250
  /     \
 AA:500  AB:1000

For simplicity, let's say all the leaf nodes have active tasks and are
on service tree.  For each leaf node, vfraction would be

 AA: (500  / 1500) * (500 / 750) =~ 0.2222
 AB: (1000 / 1500) * (500 / 750) =~ 0.4444
  B:                 (250 / 750) =~ 0.3333

and vdisktime will be distributed accordingly.  For more detail,
please refer to Documentation/block/cfq-iosched.txt.

v2: cfq-iosched.txt updated to describe group scheduling as suggested
    by Vivek.

v3: blkio-controller.txt updated.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Documentation/block/cfq-iosched.txt
Documentation/cgroups/blkio-controller.txt
block/cfq-iosched.c