Exchanged deprecated systemd resources with the appropriate for cgroupv2

Signed-off-by: Boris Popovschi <zyqsempai@mail.ru>
This commit is contained in:
Boris Popovschi 2020-01-15 14:55:22 +02:00
parent 709377ca55
commit 5b96f314ba
1 changed files with 4 additions and 9 deletions

View File

@ -81,7 +81,7 @@ func (m *UnifiedManager) Apply(pid int) error {
properties = append(properties, properties = append(properties,
newProp("MemoryAccounting", true), newProp("MemoryAccounting", true),
newProp("CPUAccounting", true), newProp("CPUAccounting", true),
newProp("BlockIOAccounting", true)) newProp("IOAccounting", true))
// Assume DefaultDependencies= will always work (the check for it was previously broken.) // Assume DefaultDependencies= will always work (the check for it was previously broken.)
properties = append(properties, properties = append(properties,
@ -89,12 +89,12 @@ func (m *UnifiedManager) Apply(pid int) error {
if c.Resources.Memory != 0 { if c.Resources.Memory != 0 {
properties = append(properties, properties = append(properties,
newProp("MemoryLimit", uint64(c.Resources.Memory))) newProp("MemoryMax", uint64(c.Resources.Memory)))
} }
if c.Resources.CpuShares != 0 { if c.Resources.CpuWeight != 0 {
properties = append(properties, properties = append(properties,
newProp("CPUShares", c.Resources.CpuShares)) newProp("CPUWeight", c.Resources.CpuWeight))
} }
// cpu.cfs_quota_us and cpu.cfs_period_us are controlled by systemd. // cpu.cfs_quota_us and cpu.cfs_period_us are controlled by systemd.
@ -117,11 +117,6 @@ func (m *UnifiedManager) Apply(pid int) error {
newProp("CPUQuotaPerSecUSec", cpuQuotaPerSecUSec)) newProp("CPUQuotaPerSecUSec", cpuQuotaPerSecUSec))
} }
if c.Resources.BlkioWeight != 0 {
properties = append(properties,
newProp("BlockIOWeight", uint64(c.Resources.BlkioWeight)))
}
if c.Resources.PidsLimit > 0 { if c.Resources.PidsLimit > 0 {
properties = append(properties, properties = append(properties,
newProp("TasksAccounting", true), newProp("TasksAccounting", true),