opencontainers / opencontainers/runc

Reading information from blkio cgroup needs to be updated

Open
#2,365 0 comments 3 reactions 0 assignees View on GitHub

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:

  1. Introduction of new I/O scheduler - BFQ, since version 4.12 of linux kernel #1, #2

  2. Introduction of blkio.throttle.io_serviced_bytes_recursive file, since version 4.16 of linux kernel #1

  3. 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:

  1. 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.

  1. Check for default BFQ files:
  • blkio.bfq.io_serviced_recursive

  • blkio.bfq.io_service_bytes_recursive

    if they exist, use them for stat reporting

  1. Check for CFQ files, if they exist, use them for stat reporting (current functionality)

  2. 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

  3. Fall back to current fallback: reporting blkio.throttle.io_service_bytes as stats.BlkioStats.IoServiceBytesRecursive and blkio.throttle.io_serviced as stats.BlkioStats.IoServicedRecursive

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.