Repository navigation
Conversation
Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
|
|
||
| page_sizes = [ | ||
| page_size for page_size in ('2MB', '1GB') | ||
| if os.path.exists(f'/sys/fs/cgroup/hugetlb.{page_size}.rsvd.max') |
There was a problem hiding this comment.
Have you ever tried running this test, and what was the result?
See, this file does not exist on a root cgroup, so the test always skips. I mentioned it in #2290.
There was a problem hiding this comment.
Updated the test to discover page sizes through hugetlb..max and check .rsvd.max from inside the container. It skips only when reservation accounting is unavailable in that container cgroup. Python compilation passed; I could not run the rootful cgroup v2 test on macOS.
There was a problem hiding this comment.
I could not run the rootful cgroup v2 test on macOS.
See my comment below #2387 (comment)
@sairex53 if you want to contribute to crun, I suggest you to actually use it and have a setup to run the tests you're authoring (perhaps in a VM). |
fixup! cgroup: apply HugeTLB reservation limits Read the reservation limit from inside the container cgroup and skip only when the controller is unavailable there. Agent: Codex
Summary
On cgroup v2, crun applied OCI
hugepageLimitsonly tohugetlb.<size>.max. When the kernel exposes reservation accounting, the correspondinghugetlb.<size>.rsvd.maxstayed unlimited, so the configured limit did not constrain hugepage reservations.Write the same limit to both files. If the reservation file is absent, keep the existing usage-accounting fallback for kernels that do not support reservation accounting; other write errors still fail. Add a runtime regression test for available 2 MB and 1 GB page sizes.
Fixes #2284.
Validation
./autogen.sh && ./configure --disable-systemd && make -j2— passed on Fedora 44 aarch64.python3 -m py_compile tests/test_cgroup_resources.py— passed.git diff --check— passed.