From 73a0603e8bbbc8fd56e57ac3b40d91dff26aab03 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 30 Oct 2015 10:34:01 -0700 Subject: [PATCH] Don't set mem soft limit if not specifiecd You cannot do this for individual cgroups for all the containers. Only set the reservation if the user requested it. The error you will receive is an EINTVAL when you try to set a large limit like we were in the memory limit. Signed-off-by: Michael Crosby Upstream-commit: ecb87ed0a5128a3d9ab3b0a620463b7b56e82bab Component: engine --- components/engine/daemon/daemon_unix.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/engine/daemon/daemon_unix.go b/components/engine/daemon/daemon_unix.go index c94ea49b52..22142bcf14 100644 --- a/components/engine/daemon/daemon_unix.go +++ b/components/engine/daemon/daemon_unix.go @@ -115,9 +115,6 @@ func (daemon *Daemon) adaptContainerSettings(hostConfig *runconfig.HostConfig, a // By default, MemorySwap is set to twice the size of Memory. hostConfig.MemorySwap = hostConfig.Memory * 2 } - if hostConfig.MemoryReservation == 0 && hostConfig.Memory > 0 { - hostConfig.MemoryReservation = hostConfig.Memory - } } // verifyPlatformContainerSettings performs platform-specific validation of the