Skip to content

Reading information from blkio cgroup needs to be updated #2365

@piowag

Description

@piowag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions