pkg/kernel: reduce Build parallelism

NumCPU*2 can create excessive number of subprocesses
in the case machine is busy with other things as well.
This commit is contained in:
Dmitry Vyukov 2017-06-19 16:48:46 +02:00
parent 9dcb6799c7
commit f94617a321

View File

@ -53,7 +53,7 @@ func Build(dir, compiler, config string, fullConfig bool) error {
}
// We build only bzImage as we currently don't use modules.
// Build of a large kernel can take a while on a 1 CPU VM.
if _, err := osutil.RunCmd(3*time.Hour, dir, "make", "bzImage", "-j", strconv.Itoa(runtime.NumCPU()*2), "CC="+compiler); err != nil {
if _, err := osutil.RunCmd(3*time.Hour, dir, "make", "bzImage", "-j", strconv.Itoa(runtime.NumCPU()), "CC="+compiler); err != nil {
return err
}
return nil