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

Added cgroup type #324

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Added cgroup type #324

merged 1 commit into from
Jan 28, 2024

Conversation

yaoyinnan
Copy link
Contributor

Add domain threaded and domain invalid cgroup type.

Add domain threaded and domain invalid cgroup type for cgroup v2.

Signed-off-by: yaoyinnan <35447132+yaoyinnan@users.noreply.github.com>
@yaoyinnan
Copy link
Contributor Author

@dcantah @kzys Hi, can you review it for me? Thanks.

@mxpv mxpv merged commit 164a9a5 into containerd:main Jan 28, 2024
8 checks passed
Comment on lines +245 to +248
Domain CgroupType = "domain"
DomainThreaded CgroupType = "domain threaded"
DomainInvalid CgroupType = "domain invalid"
Threaded CgroupType = "threaded"
Copy link
Member

@thaJeztah thaJeztah Dec 4, 2024

Choose a reason for hiding this comment

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

@yaoyinnan @dcantah @mxpv Wondering if additional changes were needed as part of this; I see Manager.Delete() has a special case for Threaded; should the same code be called when it encounters DomainThreaded ("domain threaded")?

cgroups/cgroup2/manager.go

Lines 479 to 490 in d4e976d

// Kernel prevents cgroups with running process from being removed,
// check the tree is empty.
//
// Pick the right file to read based on the cgs type.
cgType, err := c.GetType()
if err != nil {
if !os.IsNotExist(err) {
return err
}
} else {
threaded = cgType == Threaded
}

cgroups/cgroup2/manager.go

Lines 492 to 496 in d4e976d

if threaded {
tasks, err = c.Threads(true)
} else {
tasks, err = c.Procs(true)
}

code above was added in this PR;

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.

4 participants