Skip to content

Resetting CPU affinity does the opposite on 1024+ CPU systems #5023

@askervin

Description

@askervin

Description

runc versions 1.3.0 and earlier allowed container processes to run on any CPU defined in cpuset.cpus (spec.linux.resources.cpu.cpus). From v1.3.1 to currently latest v1.3.3, runc always enforces a CPU affinity. Yet the intention is to set CPU affinity mask that allows using all CPUs, the implementation sets a mask that allows only CPUs 0-1023, effectively disabling running on CPUs 1024 onwards.

The issue was introduced in PR #4858 and the problem remains after #4926, too.

Steps to reproduce the issue

  1. Try to start a container that should run on CPUs "1023,1024"
  2. Check Cpus_allowed_list in /proc/PID/status when the process is running. It is allowed to use only CPU 1023.

Describe the results you received and expected

The container should be allowed to run on all CPUs defined in the spec.

What version of runc are you using?

v1.3.3

Host OS information

No response

Host kernel information

No response

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