-
Notifications
You must be signed in to change notification settings - Fork 64
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
support pids cgroup #76
Conversation
@yylt: Do you have a use case for this ? I mean, AFAICT this PR tries to add We have been trying for a while now to avoid adding anything new cgroup v1-specific bits to NRI. |
There are still many distributions, like Rocky Linux 8, kylin linux , and the Rocky Linux 8 uses the 4.18 kernel. Since cgroup v2 recommends a kernel version higher than 5.2, I think it's still necessary to add support for the v1 version of cgroups. Additional, maybe nri should follow the OCI runtime spec more closely. If the runtime spec doesn't support a specific cgroup, then nri should remove or not add it |
Just adding a note here regarding possibility of v2 to v1 conversions .. https://github.com/opencontainers/runtime-spec/blob/main/config-linux.md#example-12 see example ^ and description: "If a controller is enabled on the cgroup v2 hierarchy but the configuration is provided for the cgroup v1 equivalent controller, the runtime MAY attempt a conversion." @AkihiroSuda thoughts? Should we be enabling both v1 and v2/unified and exposing the runtime meta at this plugin layer... or push the NRI plugins to cgroupv2 and do any nec. conversions either in CRI/shim or runtime? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have been converting memory and cpu, so converting pids SGTM
@yylt IMO, for making this really usable and getting it merged, IMO we'd need to put in a few more missing details:
The currently open PR #94 can be used as a very good example of a similar functional addition in full detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few remaining bits missing for this to become really useful and mergeable. PR #94, which adds similar functionality for OOM Score adjustment, can be used as an example/template on what needs to be done.
@klihub , thank you response. If the PID can be modified by NRI, the remaining parts will be improved accordingly. |
Done |
Signed-off-by: Yang Yang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the open issue of adding a v2 to v1 conversion ... helper
sorry, I didn't quite understand the part about 'have been converting memory and CPU.' I haven't seen any related program in Could you provide some examples? |
Will let @AkihiroSuda chime in :) But I believe this is an example: https://github.com/opencontainers/runc/blob/ad5b481dace5cda8ca7c659b7717a15517333198/libcontainer/cgroups/utils_test.go#L541-L634 |
In the examples, the focus is on the conversion from v1 to v2, primarily due to the addition of new fields or changes in the meaning in v2, necessitating the conversion. Currently, the pids only has a single limit setting (type u64), without any changes in meaning or new fields being added, so there are no any need changed here? Regarding the conversion from v2 to v1, it appears that this was initially prevented from the outset in v1, as seen in https://github.com/opencontainers/runc/blob/ad5b481dace5cda8ca7c659b7717a15517333198/libcontainer/cgroups/fs/fs.go#L175. If there are any issues or corrections needed, please feel free to point them out. Thank you. |
Fix #75