0

I have a Ubuntu 19.04 VM (kernel 5.0.0), and I found a couple of blkio cgroup files are not present in it:

    ubuntu@ip-172-31-44-196:~$ cat /etc/lsb-release 
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=19.04
    DISTRIB_CODENAME=disco
    DISTRIB_DESCRIPTION="Ubuntu 19.04"

    ubuntu@ip-172-31-44-196:~$ uname -an            
    Linux ip-172-31-44-196 5.0.0-1007-aws #7-Ubuntu SMP Thu May 16 15:18:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    ubuntu@ip-172-31-44-196:~$ ls -la /sys/fs/cgroup/blkio/
    total 0
    dr-xr-xr-x  2 root root   0 Jun 17 03:17 ./
    drwxr-xr-x 15 root root 380 Jun 17 03:14 ../
    --w-------  1 root root   0 Jun 17 03:17 blkio.reset_stats
    -r--r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.io_service_bytes
    -r--r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.io_service_bytes_recursive
    -r--r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.io_serviced
    -r--r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.io_serviced_recursive
    -rw-r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.read_bps_device
    -rw-r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.read_iops_device
    -rw-r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.write_bps_device
    -rw-r--r--  1 root root   0 Jun 17 03:17 blkio.throttle.write_iops_device
    -rw-r--r--  1 root root   0 Jun 17 03:17 cgroup.clone_children
    -rw-r--r--  1 root root   0 Jun 17 03:17 cgroup.procs
    -r--r--r--  1 root root   0 Jun 17 03:17 cgroup.sane_behavior
    -rw-r--r--  1 root root   0 Jun 17 03:17 notify_on_release
    -rw-r--r--  1 root root   0 Jun 17 03:17 release_agent
    -rw-r--r--  1 root root   0 Jun 17 03:17 tasks

In a Ubuntu 18.04 VM, I can see:

$ uname -an
Linux workstation 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ ls -la /sys/fs/cgroup/blkio
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_merged
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_merged_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_queued
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_queued_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_service_bytes
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_service_bytes_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_serviced
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_serviced_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_service_time
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_service_time_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_wait_time
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.io_wait_time_recursive
-rw-r--r--  1 root root   0 Jun 14 06:25 blkio.leaf_weight
-rw-r--r--  1 root root   0 Jun 14 06:25 blkio.leaf_weight_device
--w-------  1 root root   0 Jun 14 06:25 blkio.reset_stats
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.sectors
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.sectors_recursive
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.throttle.io_service_bytes
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.throttle.io_serviced
-rw-r--r--  1 root root   0 May 31 16:53 blkio.throttle.read_bps_device
-rw-r--r--  1 root root   0 May 31 16:53 blkio.throttle.write_iops_device
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.time
-r--r--r--  1 root root   0 Jun 14 06:25 blkio.time_recursive
-rw-r--r--  1 root root   0 May 31 16:53 blkio.weight
-rw-r--r--  1 root root   0 May 31 16:53 blkio.weight_device
...

So it seems a couple of blkio cgroup files are not present in kernel 5.0, anyone knows why? Thanks!

0

I had the same issue and after some investigation I noticed that it's related to IO Scheduler.

In my case I could see these files when using kernel 4.15 and cfq scheduler but these files didn't exist when using kernel 5.5 and mq-deadline scheduler. It seems in newer kernel versions some of these files are only exist when using bfq scheduler.

You can see your current IO scheduler for sda block device using command below:

 cat /sys/block/sda/queue/scheduler

Also you can switch to bfq using these commands:

sudo modprobe bfq
echo "bfq" | sudo tee /sys/block/sda/queue/scheduler

As you can see in this code these files are being used only when CONFIG_BFQ_CGROUP_DEBUG in kernel options is being enabled, so switching to bfq may not be enough. You can see your current kernel options using below command:

less /boot/config-`uname -r`

if CONFIG_BFQ_CGROUP_DEBUG is not exist inside config file, you should change this config file and rebuild your kernel. You can use this instruction for changing kernel config. Just add CONFIG_BFQ_CGROUP_DEBUG=y to config file and rebuild and install kernel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.