From c4f0a2aa00fcf3c50cd139f1ae0ad58f5c912e96 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 (cherry picked from commit ecb87ed0a5128a3d9ab3b0a620463b7b56e82bab) --- daemon/daemon_unix.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 3f0f9f1d6..8ea6c5c9a 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -114,9 +114,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