From 9c732ae501b5f481fd9a0a709cb0208964f5fd5e Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Tue, 23 Jun 2015 12:26:01 -0700 Subject: [PATCH] Initialize memory.swappiness cgroup to -1 Set up memory.swappiness in cgroup config so write is not attempted unless specifically set. Fixes running runc on kernels which still have the cgroup hierarchy write limitation. Docker-DCO-1.1-Signed-off-by: Phil Estes (github: estesp) --- spec_linux.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec_linux.go b/spec_linux.go index c74a383e2..6a041170e 100644 --- a/spec_linux.go +++ b/spec_linux.go @@ -186,12 +186,13 @@ func createCgroupConfig(spec *LinuxSpec, devices []*configs.Device) (*configs.Cg return nil, err } c := &configs.Cgroup{ - Name: getDefaultID(), - Parent: myCgroupPath, - AllowedDevices: append(devices, allowedDevices...), - CpuQuota: getCPUQuota(spec.Cpus), - Memory: spec.Memory * 1024 * 1024, - MemorySwap: -1, + Name: getDefaultID(), + Parent: myCgroupPath, + AllowedDevices: append(devices, allowedDevices...), + CpuQuota: getCPUQuota(spec.Cpus), + Memory: spec.Memory * 1024 * 1024, + MemorySwap: -1, + MemorySwappiness: -1, } if r := spec.Resources; r != nil { c.MemoryReservation = r.MemoryReservation