Separating cgroup Memory and MemoryReservation.

This will allow for these to be set independently. Keep the current Docker behavior where Memory and MemoryReservation are set to the value of Memory.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
This commit is contained in:
Victor Marmol 2014-04-24 05:11:43 +00:00
parent 7ff609f95d
commit bcfc527abb
3 changed files with 18 additions and 10 deletions

View file

@ -121,6 +121,10 @@ func Apply(c *cgroups.Cgroup, pid int) (cgroups.ActiveCgroup, error) {
properties = append(properties,
systemd1.Property{"MemoryLimit", dbus.MakeVariant(uint64(c.Memory))})
}
if c.MemoryReservation != 0 {
properties = append(properties,
systemd1.Property{"MemorySoftLimit", dbus.MakeVariant(uint64(c.MemoryReservation))})
}
// TODO: MemorySwap not available in systemd
if c.CpuShares != 0 {