forked from levex/cgroups-rs
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Determine cgroup mode in add_task() #104
Merged
Merged
Conversation
This file contains 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
liubin
approved these changes
Jan 13, 2023
cf00e6d
to
f4c082c
Compare
Tim-Zhang
reviewed
Feb 6, 2023
Tim-Zhang
approved these changes
Feb 7, 2023
c834a31
to
6236b49
Compare
6236b49
to
8e0bb4b
Compare
Determine the cgroup mode in add_task() to avoid the wrong operation of the caller writing threads to cgroup.threads in non-thread mode. Fixes: kata-containers#103 Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
Add UT for add_task() for cgroup v1 and v2. Fixes: kata-containers#103 Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
8e0bb4b
to
3dd0735
Compare
@Tim-Zhang @liubin I fixed |
liubin
approved these changes
Feb 9, 2023
Tim-Zhang
approved these changes
Feb 9, 2023
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, thanks @yaoyinnan
Tim-Zhang
added a commit
to Tim-Zhang/cgroups-rs
that referenced
this pull request
Mar 15, 2023
To include patches kata-containers#104, kata-containers#113. Signed-off-by: Tim Zhang <tim@hyper.sh>
Merged
jsturtevant
added a commit
to jsturtevant/rust-extensions
that referenced
this pull request
Oct 24, 2023
in cgroupv2 we should use the cgroups.proc file when adding a process (https://www.man7.org/linux/man-pages/man7/cgroups.7.html). The add_tasks function was writing to the cgroup.threads file which is only avaliable when in threaded mode. In either case our intent is to add the process not the individual threads to we should use add_task_by_tgid. See kata-containers/cgroups-rs#104 for when this was added Signed-off-by: James Sturtevant <jstur@microsoft.com>
jsturtevant
added a commit
to jsturtevant/rust-extensions
that referenced
this pull request
Oct 24, 2023
in cgroupv2 we should use the cgroups.proc file when adding a process (https://www.man7.org/linux/man-pages/man7/cgroups.7.html). The add_tasks function was writing to the cgroup.threads file which is only avaliable when in threaded mode. In either case our intent is to add the process not the individual threads to we should use add_task_by_tgid. See kata-containers/cgroups-rs#104 for when this was added Signed-off-by: James Sturtevant <jstur@microsoft.com>
github-merge-queue bot
pushed a commit
to containerd/rust-extensions
that referenced
this pull request
Oct 25, 2023
in cgroupv2 we should use the cgroups.proc file when adding a process (https://www.man7.org/linux/man-pages/man7/cgroups.7.html). The add_tasks function was writing to the cgroup.threads file which is only avaliable when in threaded mode. In either case our intent is to add the process not the individual threads to we should use add_task_by_tgid. See kata-containers/cgroups-rs#104 for when this was added Signed-off-by: James Sturtevant <jstur@microsoft.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Determine the cgroup mode in add_task() to avoid the wrong operation of the caller writing threads to cgroup.threads in non-thread mode.
Fixes: #103
Signed-off-by: yaoyinnan yaoyinnan@foxmail.com