-
Notifications
You must be signed in to change notification settings - Fork 48
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
Kernel memory limit is unsupported on Linux kenrel >= 5.16 #81
Comments
Thank you @dubek , are you ready to fix this? |
@liubin I can submit a PR with a fix, but I need to understand your preference for the solution. One option is to simply make all the set_kmem_limit operations do nothing. Another option is to try to do it and ignore the Unsupported error. In both cases the current test (that sets a value and then reads it back) won't work, so need to be removed (in test_memory_res_build). There might be other ideas. Please let me know what you think will work best (for this crate and for its users). |
Hi @dubek , @liubin , the fix for this issue is needed to enable a CI job for AMD SEV, so my interest on this. I'm not an expert on this area but I'd like to share my opinion on the solutions raised by @dubek:
|
Setting (writing into) `memory.kmem.limit_in_bytes` is not supported in Linux kernel >= 5.16 (see kernel commit 58056f77502: "memcg, kmem: further deprecate kmem.limit_in_bytes"): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58056f77502 If the write call in `set_kmem_limit()` returns EOPNOTSUPP, log a warning message but ignore the error (do nothing). Add a unit-test for `set_kmem_limit` in cgroups v1. Fix kata-containers#81
Setting (writing into) `memory.kmem.limit_in_bytes` is not supported in Linux kernel >= 5.16 (see kernel commit 58056f77502: "memcg, kmem: further deprecate kmem.limit_in_bytes"): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58056f77502 If the write call in `set_kmem_limit()` returns EOPNOTSUPP, log a warning message but ignore the error (do nothing). Add a unit-test for `set_kmem_limit` in cgroups v1. Fix kata-containers#81
Setting (writing into) `memory.kmem.limit_in_bytes` is not supported in Linux kernel >= 5.16 (see kernel commit 58056f77502: "memcg, kmem: further deprecate kmem.limit_in_bytes"): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58056f77502 If the write call in `set_kmem_limit()` returns EOPNOTSUPP, log a warning message but ignore the error (do nothing). Add a unit-test for `set_kmem_limit` in cgroups v1. Fix kata-containers#81 Signed-off-by: Dov Murik <[email protected]>
Setting (writing into) `memory.kmem.limit_in_bytes` is not supported in Linux kernel >= 5.16 (see kernel commit 58056f77502: "memcg, kmem: further deprecate kmem.limit_in_bytes"): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58056f77502 If the write call in `set_kmem_limit()` returns EOPNOTSUPP, log a warning message but ignore the error (do nothing). Add a unit-test for `set_kmem_limit` in cgroups v1. Fix kata-containers#81 Signed-off-by: Dov Murik <[email protected]>
Describe the bug
As described first in kata-containers/kata-containers#4390 , Linux 5.16 merged a change which causes writes to cgroup's
memory.kmem.limit_in_bytes
to return-ENOTSUPP
and do nothing.This means that the unit tests fail with Linux 5.16 and cgroup v1.
To reproduce this, I installed an Ubuntu 22.04 VM (default kernel 5.15). I added
systemd.unified_cgroup_hierarchy=0
to the kernel command-line. On 5.15make test
passes OK.I then installed kernel 5.16.20 from Ubuntu (link). When I run the tests:
Expected behavior
Unit tests pass.
It's a design question of whether to "swallow" the unsupported error from the OS and just do nothing, or keep the error (and fix the callers, such as kata agent). This is also related to the question in #76.
Additional context
set_kmem_limit
-- this indeed fails with OS error (95 unsupported).The text was updated successfully, but these errors were encountered: