Skip to content

kernel: CONFIG_CFS_BANDWIDTH is off, so cpu.max cannot cap an execution #1193

Closed as not planned

Description

@longhun12346

What

An adapter that runs sandboxed executions in the guest can cap memory.max and pids.max of an execution's cgroup but not its CPU time: the kernel in kernel/config-microvm has # CONFIG_CFS_BANDWIDTH is not set, so writing cpu.max fails.

Why this might matter here

#912 discusses the cost of one cgroup per execution and the limits of one cgroup for all executions. A per-execution CPU cap would need cpu.max, which needs this option. I did not find an issue or PR that asks for it (searched cpu.max, CFS, CPU limit cgroup).

Evidence (one machine, an external adapter, not the upstream agent)

With a kernel built from the same 6.18.38 sources and patches plus CONFIG_CFS_BANDWIDTH=y, a guest agent that writes cpu.max into an execution's cgroup limited a busy loop to 0.51 CPU for a 50 % limit (1.00 CPU with no limit). With the upstream release kernel the same request fails at start. I have not measured the size or boot-time cost of the option.

Proposal

Enable the option (one line, PR follows). Whether the upstream managed agent should expose cpu.max is a separate question; I am not asking for that here.

Activity

  1. ppenna commented on Nov 6, 2026

    @ppenna
    Contributor

    Closing as not planned: this will not be implemented, because it goes away with the nvx refactor (feature/nvx-refactor). #1299 and #1300, which implemented it, are closed too. Thanks for the report and the measurements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions