From 5911a9c70592ec2cf05c7c342f54f567dfe1901d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 21 Dec 2021 13:56:30 +0100 Subject: tools/syz-make: restrict make parallelism on CI Github actions VMs have 2 vCPUs (Standard_DS2_v2 class). So we don't get lots of speed up from make parallelism, but we are getting memory oversubscription and duplicated work because make invokes multiple go commands that potentially build same packages in parallel. Go command itself parallelizes compiler and test invocations. So disable make parallelism to avoid OOM kills. Update #2886 --- tools/syz-make/make.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/syz-make') diff --git a/tools/syz-make/make.go b/tools/syz-make/make.go index c11ed9e81..6a69d5dd4 100644 --- a/tools/syz-make/make.go +++ b/tools/syz-make/make.go @@ -42,6 +42,14 @@ func impl() ([]Var, error) { return nil, fmt.Errorf("unknown target %v/%v", targetOS, targetArch) } parallelism := runtime.NumCPU() + if os.Getenv("CI") != "" { + // Github actions VMs have 2 vCPUs (Standard_DS2_v2 class). So we don't get lots of speed up + // from make parallelism, but we are getting memory oversubscription and duplicated work + // because make invokes multiple go commands that potentially build same packages in parallel. + // Go command itself parallelizes compiler and test invocations. So disable make parallelism + // to avoid OOM kills. + parallelism = 1 + } if runtime.GOOS == targets.OpenBSD { // Avoids too much concurrency on OpenBSD which can't handle this much. parallelism = 1 -- cgit mrf-deployment