From ac3865ffb44cebda9c4d130a25fa61ed7f0891d9 Mon Sep 17 00:00:00 2001 From: Roman Shaposhnik Date: Fri, 23 Apr 2021 13:52:39 -0700 Subject: [PATCH] Revert "Gross hack to allow us to tweak qemu overhead" This reverts commit 4e2707b5e20aef05dca5810d88798fecd17c93af. --- pkg/pillar/hypervisor/kvm.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/pillar/hypervisor/kvm.go b/pkg/pillar/hypervisor/kvm.go index 0dd90e0d51..6613cb405a 100644 --- a/pkg/pillar/hypervisor/kvm.go +++ b/pkg/pillar/hypervisor/kvm.go @@ -21,7 +21,7 @@ import ( //TBD: Have a better way to calculate this number. //For now it is based on some trial-and-error experiments -const qemuOverHead = int64(2048 * 1024 * 1024) +const qemuOverHead = int64(600 * 1024 * 1024) const minUringKernelTag = uint64((5 << 16) | (4 << 8) | (72 << 0)) @@ -424,13 +424,7 @@ func (ctx kvmContext) Setup(status types.DomainStatus, config types.DomainConfig return logError("failed to add kvm hypervisor loader to domain %s: %v", status.DomainName, err) } - effectiveQemuOverHead := qemuOverHead - if s, err := ioutil.ReadFile("/config/qemu_overhead.cfg"); err == nil { - if i, err := strconv.Atoi(string(s)); err == nil && i > 0 { - effectiveQemuOverHead = int64(i) - } - } - spec.AdjustMemLimit(config, effectiveQemuOverHead) + spec.AdjustMemLimit(config, qemuOverHead) spec.Get().Process.Args = args if err := spec.CreateContainer(true); err != nil { return logError("Failed to create container for task %s from %v: %v", status.DomainName, config, err)