Skip to content

Commit

Permalink
pkg/mgrconfig: increase the timeouts if running on QEMU with TCG
Browse files Browse the repository at this point in the history
Previously we were assuming that QEMU with matching host/guest
architectures was using -enable-kvm, but for arm64 that's not always the
case.
  • Loading branch information
ramosian-glider committed Oct 22, 2024
1 parent a93682b commit 0777391
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/mgrconfig/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package mgrconfig

import (
"bytes"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -237,6 +238,11 @@ func (cfg *Config) completeServices() error {
func (cfg *Config) initTimeouts() {
slowdown := 1
switch {
case cfg.Type == "qemu" && (runtime.GOARCH == cfg.SysTarget.Arch || runtime.GOARCH == cfg.SysTarget.VMArch):
// If TCG is enabled for QEMU, increase the slowdown.
if bytes.Contains(cfg.VM, []byte("-accel tcg")) {
slowdown = 10
}
case cfg.Type == "qemu" && runtime.GOARCH != cfg.SysTarget.Arch && runtime.GOARCH != cfg.SysTarget.VMArch:
// Assuming qemu emulation.
// Quick tests of mmap syscall on arm64 show ~9x slowdown.
Expand Down

0 comments on commit 0777391

Please sign in to comment.