Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] We should check memory.swap.max exists or not for cgroupv2 #4166

Open
lifubang opened this issue Jan 8, 2024 · 1 comment · May be fixed by #4188
Open

[ci] We should check memory.swap.max exists or not for cgroupv2 #4166

lifubang opened this issue Jan 8, 2024 · 1 comment · May be fixed by #4188
Labels

Comments

@lifubang
Copy link
Member

lifubang commented Jan 8, 2024

I think in some old kernel with cgroupv2 enabled, memory.swap.max is not exist. For example:

Linux iZj6cdnzj9sp96xf38htrnZ 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

root@iZj6cdnzj9sp96xf38htrnZ:~# ls /sys/fs/cgroup/user.slice/user-0.slice/session-1.scope/
cgroup.controllers      cgroup.stat             cpuset.cpus            cpu.uclamp.max   io.stat              memory.low        pids.current
cgroup.events           cgroup.subtree_control  cpuset.cpus.effective  cpu.uclamp.min   io.weight            memory.max        pids.events
cgroup.freeze           cgroup.threads          cpuset.cpus.partition  cpu.weight       memory.current       memory.min        pids.max
cgroup.max.depth        cgroup.type             cpuset.mems            cpu.weight.nice  memory.events        memory.oom.group  rdma.current
cgroup.max.descendants  cpu.max                 cpuset.mems.effective  io.max           memory.events.local  memory.pressure   rdma.max
cgroup.procs            cpu.pressure            cpu.stat               io.pressure      memory.high          memory.stat

Then we will get some errors when setting memory swap limit:

not ok 164 update cgroup v1/v2 common limits
# (in test file tests/integration/update.bats, line 103)
#   `[ "$status" -eq 0 ]' failed
# runc spec (status=0):
#
# runc run -d --console-socket /tmp/bats-run-YCqIW9/runc.6WEppA/tty/sock test_update (status=0):
#
# current 33554432 !? 33554432
# current 25165824 !? 25165824
# current 20 !? 20
# runc update test_update --cpuset-cpus 1 (status=0):
#
# current 1 !? 1
# runc update test_update --memory 67108864 (status=0):
#
# current 67108864 !? 67108864
# runc update test_update --memory 50M (status=0):
#
# current 52428800 !? 52428800
# runc update test_update --memory-reservation 33554432 (status=0):
#
# current 33554432 !? 33554432
# runc update test_update --memory-swap -1 (status=1):
# time="2024-01-08T11:36:37+08:00" level=warning msg="Setting back cgroup configs failed due to error: open /sys/fs/cgroup/runc-cgroups-integration-test/test-cgroup-12193/memory.swap.max: no such file or directory, your state.json and actual configs might be inconsistent."
# time="2024-01-08T11:36:37+08:00" level=error msg="open /sys/fs/cgroup/runc-cgroups-integration-test/test-cgroup-12193/memory.swap.max: no such file or directory"
@kolyshkin kolyshkin linked a pull request Feb 2, 2024 that will close this issue
@kolyshkin
Copy link
Contributor

kolyshkin commented Feb 2, 2024

Should be fixed by #4188.

I think in some old kernel with cgroupv2 enabled, memory.swap.max is not exist.

I think this can just be that CONFIG_SWAP is not set in the kernel config (i.e. any kernel, not just some old one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants