Skip to content
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

runtime: using threaded mode to manage cgroupv2 #5153

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yaoyinnan
Copy link
Member

In the current cgroupv2, because the process mode cannot separate processes and threads into different cgroups, the vmm process is incorrectly added to the sandbox cgroup. The sandbox and overhead are placed in the same cgroup through thread mode to realize that the vCPU thread is placed in the sandbox and other processes are placed in the overhead.

image

Fixes: #4886

Signed-off-by: yaoyinnan yaoyinnan@foxmail.com

@katacontainersbot katacontainersbot added the size/medium Average sized task label Sep 9, 2022
@yaoyinnan yaoyinnan changed the title fix: Using threaded mode for management in cgroupv2 runtime: Using threaded mode for management in cgroupv2 Sep 9, 2022
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 2 times, most recently from 0d7a4e3 to a2bd465 Compare September 11, 2022 03:06
@liubin
Copy link
Member

liubin commented Sep 13, 2022

It seems that containerd/cgroups doesn't support macOS very well.
/test

@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 8 times, most recently from 02830ed to 3033e53 Compare September 14, 2022 02:38
@yaoyinnan
Copy link
Member Author

yaoyinnan commented Sep 14, 2022

It seems that containerd/cgroups doesn't support macOS very well. /test

Yes, it looks like this repo doesn't support macOS. The containerd/cgroups#55 also mentioned this situation.

@yaoyinnan yaoyinnan requested a review from a team as a code owner September 14, 2022 07:59
@katacontainersbot katacontainersbot added size/large Task of significant size and removed size/medium Average sized task labels Sep 14, 2022
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 3 times, most recently from 29f109a to f681471 Compare September 15, 2022 13:53
@liubin
Copy link
Member

liubin commented Sep 15, 2022

/test

@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 2 times, most recently from 9158df6 to 9c9d89a Compare September 16, 2022 02:53
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 3 times, most recently from f6765f9 to c01013d Compare September 21, 2022 05:42
@yaoyinnan
Copy link
Member Author

/test-fedora
/test-ubuntu

@yaoyinnan
Copy link
Member Author

/test-s390x

@yaoyinnan yaoyinnan mentioned this pull request Feb 9, 2023
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch from c6d19b4 to eb1ead3 Compare February 11, 2023 11:42
@yaoyinnan
Copy link
Member Author

/test

@yaoyinnan
Copy link
Member Author

@bergwolf @jodh-intel @fidencio @snir911 This PR has basically been completed. Can you review and push to approve this PR for me?

@yaoyinnan yaoyinnan added the area/runtime Issues that impact the runtime (including shimv2) label Feb 17, 2023
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch from eb1ead3 to 0730c0b Compare January 19, 2024 07:09
@katacontainersbot katacontainersbot added size/huge Largest and most complex task (probably needs breaking into small pieces) and removed size/large Task of significant size labels Jan 19, 2024
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch from 0730c0b to c0e2a17 Compare January 19, 2024 07:18
@yaoyinnan
Copy link
Member Author

/test

@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 2 times, most recently from 682c784 to e291eea Compare January 26, 2024 13:13
@katacontainersbot katacontainersbot added size/large Task of significant size and removed size/huge Largest and most complex task (probably needs breaking into small pieces) labels Jan 26, 2024
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch 2 times, most recently from 199224e to 5f52358 Compare January 27, 2024 13:50
@yaoyinnan yaoyinnan changed the title runtime: Using threaded mode for management in cgroupv2 runtime: using threaded mode to manage cgroupv2 Jan 27, 2024
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch from 5f52358 to 83c82dd Compare January 29, 2024 08:25
Update the description that threaded mode for management in cgroupv2 in host cgroups docs

Fixes: kata-containers#4886
Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
Because cgroups linux has modified the interface, the cgroups darwin interface has been unified.

Fixes: kata-containers#4886

Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
The sandbox and overhead are placed in the same cgroup through threaded mode.

Fixes: kata-containers#4886

Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
For different versions of cgroups, use different methods to delete cgroups. For cgroup v2, you need to delete the thread mode cgroup first.

Fixes: kata-containers#4886

Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
Retry delete and moveto operations to ensure cgroup resource recycling.

Fixes: kata-containers#4886

Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
@yaoyinnan yaoyinnan force-pushed the 4886/fix/cgroupv2-threaded-mode branch from 83c82dd to e629db1 Compare February 1, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime Issues that impact the runtime (including shimv2) no-backport-needed Changed do not need to be applied to an older branch / repository size/large Task of significant size
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vmm process was incorrectly added to kata_sandbox cgroup in cgroup v2
4 participants