Skip to content

Commit

Permalink
cpuset: don't set cpuset.mems in the guest
Browse files Browse the repository at this point in the history
Kata doesn't map any numa topologies in the guest. Let's make sure we
clear the Cpuset fields before passing container updates to the
guest.

Note, in the future we may want to have a vCPU to guest CPU mapping and
still include the cpuset.Cpus. Until we have this support, clear this as
well.

Fixes: kata-containers#932

Signed-off-by: Eric Ernst <[email protected]>
  • Loading branch information
egernst committed Oct 13, 2020
1 parent 88cd712 commit d8a8fe4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/runtime/virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,14 @@ func (c *Container) update(resources specs.LinuxResources) error {
}
}

// There currently isn't a notion of cpusets.cpus or mems being tracked
// inside of the guest. Make sure we clear these before asking agent to update
// the container's cgroups.
if resources.CPU != nil {
resources.CPU.Mems = ""
resources.CPU.Cpus = ""
}

return c.sandbox.agent.updateContainer(c.sandbox, *c, resources)
}

Expand Down

0 comments on commit d8a8fe4

Please sign in to comment.