Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
sandbox: when updating cgroups, check cpuset
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Ernst <eric@amperecomputing.com>
  • Loading branch information
Eric Ernst committed Jun 29, 2020
1 parent 1eade24 commit d3a828b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1929,9 +1929,21 @@ func (s *Sandbox) GetHypervisorType() string {
func (s *Sandbox) cgroupsUpdate() error {

// If Kata is configured for SandboxCgroupOnly, the VMM and its processes are already
// in the Kata sandbox cgroup (inherited). No need to move threads/processes, and we should
// rely on parent's cgroup CPU/memory values
// in the Kata sandbox cgroup (inherited). Check to see if sandbox cpuset needs to be
// updated.
if s.config.SandboxCgroupOnly {
cpuset, err := s.getSandboxCpuSet()
if err != nil {
return err
}

if cpuset != "" {
s.Logger().Warn("EGERNST: cpuset: %s", cpuset)
if err := s.cgroupMgr.UpdateCpuSets(cpuset); err != nil {
return err
}
}

return nil
}

Expand Down

0 comments on commit d3a828b

Please sign in to comment.