diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-08-21 14:37:44 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-08-22 09:49:03 +0000 |
| commit | 295a4b502e10748d2a48a91eba70d77ce4d09fd4 (patch) | |
| tree | 148d2c4e54881fa73863c0058ae50bf3cb12e9e9 | |
| parent | ea1cd5ff3029315c1f89b98b820ceeebfba0e4df (diff) | |
syz-ci: accept a BuildJobs parameter
The parameter defines the maximum number of CPUs involved in the kernel
build process.
| -rw-r--r-- | pkg/bisect/bisect.go | 2 | ||||
| -rw-r--r-- | pkg/instance/instance.go | 2 | ||||
| -rw-r--r-- | syz-ci/jobs.go | 1 | ||||
| -rw-r--r-- | syz-ci/manager.go | 1 | ||||
| -rw-r--r-- | syz-ci/syz-ci.go | 4 |
5 files changed, 9 insertions, 1 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 2654b5dec..1fd08d1ca 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -37,6 +37,7 @@ type Config struct { Manager *mgrconfig.Config BuildSemaphore *instance.Semaphore TestSemaphore *instance.Semaphore + BuildJobs int // CrossTree specifies whether a cross tree bisection is to take place, i.e. // Kernel.Commit is not reachable from Kernel.Branch. // In this case, bisection starts from their merge base. @@ -625,6 +626,7 @@ func (env *env) build() (*vcs.Commit, string, error) { CmdlineFile: kern.Cmdline, SysctlFile: kern.Sysctl, KernelConfig: bisectEnv.KernelConfig, + BuildJobs: env.cfg.BuildJobs, }) if imageDetails.CompilerID != "" { env.log("compiler: %v", imageDetails.CompilerID) diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index c5e53aa6d..0012444f0 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -49,6 +49,7 @@ type BuildKernelConfig struct { CmdlineFile string SysctlFile string KernelConfig []byte + BuildJobs int } func NewEnv(cfg *mgrconfig.Config, buildSem, testSem *Semaphore) (Env, error) { @@ -153,6 +154,7 @@ func (env *env) BuildKernel(buildCfg *BuildKernelConfig) ( CmdlineFile: buildCfg.CmdlineFile, SysctlFile: buildCfg.SysctlFile, Config: buildCfg.KernelConfig, + BuildJobs: buildCfg.BuildJobs, } details, err := build.Image(params) if err != nil { diff --git a/syz-ci/jobs.go b/syz-ci/jobs.go index 8e40ddab7..e49df1542 100644 --- a/syz-ci/jobs.go +++ b/syz-ci/jobs.go @@ -493,6 +493,7 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error { BinDir: jp.cfg.BisectBinDir, Linker: mgr.mgrcfg.Linker, Ccache: jp.cfg.Ccache, + BuildJobs: jp.cfg.BuildJobs, Kernel: bisect.KernelConfig{ Repo: req.KernelRepo, Branch: req.KernelBranch, diff --git a/syz-ci/manager.go b/syz-ci/manager.go index 218f7ecc4..108a8f909 100644 --- a/syz-ci/manager.go +++ b/syz-ci/manager.go @@ -356,6 +356,7 @@ func (mgr *Manager) build(kernelCommit *vcs.Commit) error { SysctlFile: mgr.mgrcfg.KernelSysctl, Config: mgr.configData, Build: mgr.mgrcfg.Build, + BuildJobs: mgr.cfg.BuildJobs, } details, err := build.Image(params) info := mgr.createBuildInfo(kernelCommit, details.CompilerID) diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index d27db6c6c..639a9bb8c 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -126,7 +126,9 @@ type Config struct { // The list is concatenated with the similar parameter from ManagerConfig. BisectBackports []vcs.BackportCommit `json:"bisect_backports"` Ccache string `json:"ccache"` - Managers []*ManagerConfig `json:"managers"` + // BuildJobs defines the maximum number of parallel kernel build threads. + BuildJobs int `json:"build_jobs"` + Managers []*ManagerConfig `json:"managers"` // Poll period for jobs in seconds (optional, defaults to 10 seconds) JobPollPeriod int `json:"job_poll_period"` // Set up a second (parallel) job processor to speed up processing. |
