-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix discrepancy between systemd and fs cgroup managers #2813
Comments
+1 on this one! I have been working with this from the k8s side, so I can help with insight if needed. Anything special you need? I also think we should strive to adhere to the systemd delegation a bit better as well (eg we don't need to write to I think crun only create the slice/scope, and has a separate sub-cgroup (for v2 at least) where they enforce limits. I do however the runc approach is better, since we actually use the systemd-api. |
The changes you are talking about here make sense for k8s, since we always use Set after Apply in order to enforce limits. The systemd-part is however currently broken/has never really made sense, but that should be fixed with: kubernetes/kubernetes#98374 (feel free to look at that PR and/or review if you have any thoughts. The PR will also not be a part of 1.21, so targeting 1.22). |
So we're good |
One particular thing this fixes is, with #2812 applied, while trying to start container with very low memory limit on cgroup v1, we get: fs driver:
systemd driver:
(this is actually how I found this) |
All cgroup managers implement
Apply()
andSet()
methods:fs/fs2 cgroup managers implement the functionality as per the description above.
systemd v1/v2 managers are somewhat weird. They set most of cgroup limits (those that can be projected to systemd unit properties) in Apply(), and they set all cgroup limits in Set -- first indirectly via systemd properties -- same as in Apply, then via cgroupfs (actually backed by fs manager)).
To reiterate, systemd managers are peculiar since:
Since runc calls both
Apply()
andSet()
, this is not really a problem, except for some curious side effects (such as #2812 (comment)). This might be worse for other users (need to be looked at).The proposed solution is not set and resources in Apply (the actual fix is surprisingly tidy -- see PR #2813).
TODO:
The text was updated successfully, but these errors were encountered: