Skip to content

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
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