Since the creation of runc/libcontainer/cgroups/fs/blkio.go, some sweeping changes took place in blkio cgroup in kernel source code, among them:
-
Introduction of new I/O scheduler - BFQ, since version 4.12 of linux kernel #1, #2
-
Introduction of blkio.throttle.io_serviced_bytes_recursive file, since version 4.16 of linux kernel #1
-
Deprecation of CFQ I/O scheduler since version 5.0 of linux kernel #1
As such when using newer kernel versions, stats given by runc/libcontainer/cgroups/fs/blkio.go are largely incomplete.
I would like to update the method of reading from blkio, but we want to ask for opinion as to not impact users using it on older kernel versions.
Suggested new logic:
- Check for BFQ debug files enabled by BFQ_CGROUP_DEBUG:
-
blkio.bfq.sectors_recursive
-
blkio.bfq.io_service_time_recursive
-
blkio.bfq.io_wait_time_recursive
-
blkio.bfq.io_merged_recursive
-
blkio.bfq.io_queued_recursive
-
blkio.bfq.time_recursive
if they exist, use them and default files from next point for stat reporting.
- Check for default BFQ files:
-
blkio.bfq.io_serviced_recursive
-
blkio.bfq.io_service_bytes_recursive
if they exist, use them for stat reporting
-
Check for CFQ files, if they exist, use them for stat reporting (current functionality)
-
Check for blkio.throttle.io_service_bytes_recursive, if it exists report blkio.throttle.io_service_bytes_recursive as stats.BlkioStats.IoServiceBytesRecursive and blkio.throttle.io_serviced_recursive as stats.BlkioStats.IoServicedRecursive
-
Fall back to current fallback: reporting blkio.throttle.io_service_bytes as stats.BlkioStats.IoServiceBytesRecursive and blkio.throttle.io_serviced as stats.BlkioStats.IoServicedRecursive
Since the creation of runc/libcontainer/cgroups/fs/blkio.go, some sweeping changes took place in blkio cgroup in kernel source code, among them:
Introduction of new I/O scheduler - BFQ, since version 4.12 of linux kernel #1, #2
Introduction of
blkio.throttle.io_serviced_bytes_recursivefile, since version 4.16 of linux kernel #1Deprecation of CFQ I/O scheduler since version 5.0 of linux kernel #1
As such when using newer kernel versions, stats given by runc/libcontainer/cgroups/fs/blkio.go are largely incomplete.
I would like to update the method of reading from blkio, but we want to ask for opinion as to not impact users using it on older kernel versions.
Suggested new logic:
blkio.bfq.sectors_recursiveblkio.bfq.io_service_time_recursiveblkio.bfq.io_wait_time_recursiveblkio.bfq.io_merged_recursiveblkio.bfq.io_queued_recursiveblkio.bfq.time_recursiveif they exist, use them and default files from next point for stat reporting.
blkio.bfq.io_serviced_recursiveblkio.bfq.io_service_bytes_recursiveif they exist, use them for stat reporting
Check for CFQ files, if they exist, use them for stat reporting (current functionality)
Check for
blkio.throttle.io_service_bytes_recursive, if it exists reportblkio.throttle.io_service_bytes_recursiveasstats.BlkioStats.IoServiceBytesRecursiveandblkio.throttle.io_serviced_recursiveasstats.BlkioStats.IoServicedRecursiveFall back to current fallback: reporting
blkio.throttle.io_service_bytesasstats.BlkioStats.IoServiceBytesRecursiveandblkio.throttle.io_servicedasstats.BlkioStats.IoServicedRecursive