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. Without this, we could encounter a runtime failure:

```
process_linux.go:297: applying cgroup configuration for process caused
"failed to write 0,1 to cpuset.mems: writea 0,1 to cpuset.mems: write
0,1 to cpuset.mems: write /sys/fs/cgroup/cpuset .... /cpuset.mems:
numerical result out of range"": unknown
```

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

Signed-off-by: Eric Ernst <[email protected]>
  • Loading branch information
egernst committed Sep 10, 2020
1 parent 038a700 commit d96296f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,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 d96296f

Please sign in to comment.