diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2021-12-21 13:56:30 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2021-12-21 18:52:46 +0100 |
| commit | 5911a9c70592ec2cf05c7c342f54f567dfe1901d (patch) | |
| tree | d9295a37e31d319825f46cd92273416029135a27 /tools | |
| parent | 1d71282dce3914b59b079f3d010f32a4b6c149f6 (diff) | |
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
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-make/make.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
