]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/blk-cgroup.c
blkcg: use CGROUP_WEIGHT_* scale for io.weight on the unified hierarchy
authorTejun Heo <tj@kernel.org>
Tue, 18 Aug 2015 21:55:36 +0000 (14:55 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 18 Aug 2015 22:49:36 +0000 (15:49 -0700)
commit69d7fde5909b614114343974cfc52cb8ff30b544
tree231d68d331b286767109c616823781ed030ecb2b
parent3ecca62931ee6a30822a1ab7299bc8b8a21e5288
blkcg: use CGROUP_WEIGHT_* scale for io.weight on the unified hierarchy

cgroup is trying to make interface consistent across different
controllers.  For weight based resource control, the knob should have
the range [1, 10000] and default to 100.  This patch updates
cfq-iosched so that the weight range conforms.  The internal
calculations have enough range and the widening of the weight range
shouldn't cause any problem.

* blkcg_policy->cpd_bind_fn() is added.  If present, this is invoked
  when blkcg is attached to a hierarchy.

* cfq_cpd_init() is updated to use the new default value on the
  unified hierarchy.

* cfq_cpd_bind() callback is implemented to clear per-blkg configs and
  apply the default config matching the hierarchy type.

* cfqd->root_group->[leaf_]weight initialization in cfq_init_queue()
  is moved into !CONFIG_CFQ_GROUP_IOSCHED block.  cfq_cpd_bind() is
  now responsible for initializing the initial weights when blkcg is
  enabled.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Documentation/cgroups/unified-hierarchy.txt
block/blk-cgroup.c
block/cfq-iosched.c
include/linux/blk-cgroup.h