Skip to content

runsc/cgroup: set swap for precreated cgroups#13276

Open
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-cgroup-swap
Open

runsc/cgroup: set swap for precreated cgroups#13276
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-cgroup-swap

Conversation

@Haihan-Jiang
Copy link
Copy Markdown

Summary

  • honor OCI LinuxResources.Memory.Swap for cgroup v2 paths that were pre-created by the caller
  • keep the existing pre-created-cgroup ownership behavior for other resource knobs, so runsc does not overwrite pod CPU or memory limits it does not own
  • add a regression test that verifies memory.swap.max is updated while memory.max stays untouched

Fixes #13267

Testing

  • git diff --check
  • bazel test //runsc/cgroup:cgroup_test (fails before running tests on this macOS host because /usr/bin/x86_64-linux-gnu-gcc is not installed for the //vdso:vdso genrule)

@Haihan-Jiang Haihan-Jiang marked this pull request as ready for review May 24, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runsc does not honor OCI LinuxResources.Memory.Swap when joining the pod cgroup, leaving K8s LimitedSwap unenforced for gVisor pods

1 participant