cgroup: use cgroup.kill if available#724
Merged
giuseppe merged 2 commits intocontainers:mainfrom Aug 31, 2021
Merged
Conversation
aa66c62 to
dbd5d2c
Compare
flouthoc
reviewed
Aug 27, 2021
Collaborator
flouthoc
left a comment
There was a problem hiding this comment.
I am not sure but should we silently fallback to killing process iteratively when write( fails for cgroup.kill instead of returning crun_error
Member
Author
yes, I think we need to fallback in any case. Either if it is not supported, or if for any reason it fail, so we don't leave processes around. |
Member
|
I agree we should fall back and try our best to kill all of the processes in the cgroup. |
dbd5d2c to
8eaabf6
Compare
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Linux 5.14 supports the file "cgroup.kill" to kill all the processes in a cgroup. It avoids the cost of opening "cgroup.procs" and send the kill signal to each process listed. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
8eaabf6 to
8a70bcd
Compare
flouthoc
approved these changes
Aug 31, 2021
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux 5.14 supports the file "cgroup.kill" to kill all the processes
in a cgroup. It avoids the cost of opening "cgroup.procs" and send
the kill signal to each process listed.
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com