Conversation
bduffany
force-pushed
the
task-cgroup-cpu-controller
branch
from
October 5, 2026 15:43
ea39d27 to
d2b7065
Compare
bduffany
marked this pull request as draft
October 5, 2026 18:43
bduffany
force-pushed
the
task-cgroup-cpu-controller
branch
3 times, most recently
from
October 5, 2026 20:23
7c16d20 to
6aca341
Compare
bduffany
force-pushed
the
task-cgroup-cpu-controller
branch
from
October 5, 2026 20:23
6aca341 to
bc67247
Compare
bduffany
marked this pull request as ready for review
October 5, 2026 20:28
vanja-p
approved these changes
Oct 6, 2026
| memoryBytes: args.Task.GetSchedulingMetadata().GetTaskSize().GetEstimatedMemoryBytes(), | ||
| useOCIFetcher: args.Props.UseOCIFetcher, | ||
|
|
||
| runtimePIDs: map[int]struct{}{}, |
Contributor
There was a problem hiding this comment.
nit: you can use server/util/set here
|
|
||
| c.cgroupMu.Lock() | ||
| defer c.cgroupMu.Unlock() | ||
| err := cgroup.SignalAll(c.cgroupPath(), sig, func(pid int) bool { |
Contributor
There was a problem hiding this comment.
if runtimePIDs was a set, then this could be:
err := cgroup.SignalAll(c.cgroupPath(), sig, c.runtimePIDs.Contains)
| // Without a cgroup manager, crun leaves container processes in the cgroup | ||
| // that crun runs in. So start the commands that create container | ||
| // processes directly in the task's cgroup. | ||
| startInCgroup := !crunManagesCgroups() && (args[0] == "run" || args[0] == "create" || args[0] == "exec") |
Contributor
There was a problem hiding this comment.
can you document the importance of (args[0] == "run" || args[0] == "create" || args[0] == "exec")?
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Allow disabling the task cgroup CPU controller, which disables tasksize-based CPU weighting. This requires disabling it both during child cgroup setup, as well as disabling
crun's cgroup manager, which tries to enable the CPU controller on ancestor cgroups.Unfortunately, disabling
crun's cgroup manager requires us to manage a few details that crun's manager otherwise manages for us, but I think it's OK. The implementation tries to matchcrun's behavior as closely as possible.