Skip to content

Conversation

@yaoyinnan
Copy link
Contributor

Provides a method for the cgroup v2 manager to support moving processes to a specified cgroup.

Fixes: #234

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

Provides a method for the cgroup v2 manager to support moving processes to a specified cgroup.

Fixes: containerd#234

Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
@yaoyinnan yaoyinnan changed the title Cgroup v2: Support cgroup.MoveTo in cgroupv2 manager feat(v2): Support cgroup.MoveTo in cgroupv2 manager Jun 8, 2022
@yaoyinnan
Copy link
Contributor Author

@estesp Please help me review this PR. kata-containers/kata-containers#4397 needs this PR to be merged. Thanks.

@estesp
Copy link
Member

estesp commented Jun 15, 2022

Given there is no test, how have you validated this works properly on cgroups v2? I notice that it works differently than the v1 MoveTo and curious if the error condition is the exact same (given it uses string matching).

@estesp estesp requested a review from AkihiroSuda June 15, 2022 14:46
@yaoyinnan
Copy link
Contributor Author

@estesp I tested the error in the cgroupv2 environment, the error message contains "no such process", the content is as follows:

error="error: write /sys/fsrouproup.procs: no such process"

This MoveTo() method exists in cgroup v1, but does not exist in cgroup v2's Manager. I need to be compatible with this method in order to make Kata compatible with cgroup v1 and cgroup v2 systems. In Kata I tested this function and it works fine.

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaoyinnan
Copy link
Contributor Author

@AkihiroSuda Please help me review this PR. Thanks.

@yaoyinnan
Copy link
Contributor Author

yaoyinnan commented Jun 23, 2022

@estesp Please help me contact @AkihiroSuda to help me review this PR, the kata-containers/kata-containers#4397 needs to wait for #235 to be merged. Thanks.

@AkihiroSuda
Copy link
Member

Please consider adding a test

Add unit test TestMoveTo() for manager.MoveTo().

Fixes: containerd#234

Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
@yaoyinnan
Copy link
Contributor Author

@AkihiroSuda I have added the test.

@AkihiroSuda AkihiroSuda merged commit cf7417b into containerd:main Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cgroup v2: Support cgroup.MoveTo in cgroupv2 manager

3 participants