読者です 読者をやめる 読者になる 読者になる

If mounted cgroup blkio directory have files less than you were expected

You may need to set more kernel configuration parameters.

The blkio subsystem can be appear if you set CONFIG_BLK_CGROUP to be yes even if you didn't set all required parameters in kernel configuration. You can find all needed configurations for blkio subsystem in $KERNEL_SRC_ROOT/Documentation/cgroups/blkio-controller.txt

Before

$ sudo mkdir -p /cgroup/blkio
$ sudo mount -t cgroup -o blkio blkio /cgroup/blkio
$ ls -l /cgroup/blkio 
total 0
--w------- 1 root root 0 Feb 10 18:49 blkio.reset_stats
-rw-r--r-- 1 root root 0 Feb 10 18:49 cgroup.clone_children
--w--w--w- 1 root root 0 Feb 10 18:49 cgroup.event_control
-rw-r--r-- 1 root root 0 Feb 10 18:49 cgroup.procs
-r--r--r-- 1 root root 0 Feb 10 18:49 cgroup.sane_behavior
-rw-r--r-- 1 root root 0 Feb 10 18:49 notify_on_release
-rw-r--r-- 1 root root 0 Feb 10 18:49 release_agent
-rw-r--r-- 1 root root 0 Feb 10 20:57 tasks
$ zcat /proc/config.gz | grep -e CFQ_GROUP_IOSCHED -e DEV_THROTTLING
# CONFIG_BLK_DEV_THROTTLING is not set
# CONFIG_CFQ_GROUP_IOSCHED is not set

After kernel recompiled

$ zcat /proc/config.gz | grep -e CFQ_GROUP_IOSCHED -e DEV_THROTTLING
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_CFQ_GROUP_IOSCHED=y
$ sudo mount -t cgroup -o blkio blkio /cgroup/blkio
$ ls -l /cgroup/blkio 
total 0
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_merged
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_merged_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_queued
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_queued_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_service_bytes
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_service_bytes_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_service_time
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_service_time_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_serviced
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_serviced_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_wait_time
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.io_wait_time_recursive
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.leaf_weight
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.leaf_weight_device
--w------- 1 root root 0 Feb 10 18:49 blkio.reset_stats
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.sectors
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.sectors_recursive
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.io_service_bytes
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.io_serviced
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.read_bps_device
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.read_iops_device
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.write_bps_device
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.throttle.write_iops_device
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.time
-r--r--r-- 1 root root 0 Feb 10 18:49 blkio.time_recursive
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.weight
-rw-r--r-- 1 root root 0 Feb 10 18:49 blkio.weight_device
-rw-r--r-- 1 root root 0 Feb 10 18:49 cgroup.clone_children
--w--w--w- 1 root root 0 Feb 10 18:49 cgroup.event_control
-rw-r--r-- 1 root root 0 Feb 10 18:49 cgroup.procs
-r--r--r-- 1 root root 0 Feb 10 18:49 cgroup.sane_behavior
-rw-r--r-- 1 root root 0 Feb 10 18:49 notify_on_release
-rw-r--r-- 1 root root 0 Feb 10 18:49 release_agent
-rw-r--r-- 1 root root 0 Feb 10 20:57 tasks