opencontainers / opencontainers/runc
Reading information from blkio cgroup needs to be updated
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Description
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 #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_recursiveif 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_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.IoServicedRecursive -
Fall back to current fallback: reporting
blkio.throttle.io_service_bytesasstats.BlkioStats.IoServiceBytesRecursiveandblkio.throttle.io_servicedasstats.BlkioStats.IoServicedRecursive
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libcontainer/cgroups/fs/blkio.go and compare its current readers with the kernel's BFQ and throttle file names linked in the issue. Trace how stats.BlkioStats.IoServiceBytesRecursive and IoServicedRecursive are populated, then inspect existing cgroup tests if present. Done means newer BFQ and throttle layouts are reported while the stated CFQ and older-kernel fallbacks remain compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- backend, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100