libcontainer: cgroups: add support for kmem.tcp limits

Kernel TCP memory has its own special knobs inside the cgroup.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai
2016-03-20 21:45:52 +11:00
parent 54a6e56004
commit 1448fe9568
4 changed files with 40 additions and 0 deletions
+3
View File
@@ -382,6 +382,9 @@ func createCgroupConfig(name string, spec *specs.Spec) (*configs.Cgroup, error)
if r.Memory.Kernel != nil {
c.Resources.KernelMemory = int64(*r.Memory.Kernel)
}
if r.Memory.KernelTCP != nil {
c.Resources.KernelMemoryTCP = int64(*r.Memory.KernelTCP)
}
if r.Memory.Swappiness != nil {
swappiness := int64(*r.Memory.Swappiness)
c.Resources.MemorySwappiness = &swappiness