From d8a8fe47fbb14ab5ce1f08235caa5bdf9d6198a4 Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Mon, 12 Oct 2020 21:18:08 -0700 Subject: [PATCH] cpuset: don't set cpuset.mems in the guest 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: #932 Signed-off-by: Eric Ernst --- src/runtime/virtcontainers/container.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/runtime/virtcontainers/container.go b/src/runtime/virtcontainers/container.go index 2c49b14bc5..21f18f35d7 100644 --- a/src/runtime/virtcontainers/container.go +++ b/src/runtime/virtcontainers/container.go @@ -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) }