Build modules: no thread limit without the composer's share; with it, the share over their own capacity (ADR 0553 round 2)
Change A rebuilds the three build modules, so their runtimes restart once; it changes nothing else about their builds until change B gives them the share.
This commit is contained in:
@@ -6,13 +6,12 @@ import (
|
||||
)
|
||||
|
||||
// The processors a step may take (novox/hq ADR 0553, issue 1806). The node-engine holds this module's runtime, with
|
||||
// every other build module's of the node, in one slice at idle priority under the node's one share of its processors;
|
||||
// inside that bound a step starts no more threads than its part of it: the share divided by every build slot of the
|
||||
// node, from the words the composer gives (buildstep.NodeLimits), so the steps running at once do not wait in the
|
||||
// kernel's throttle.
|
||||
// every other build module's of the node, in one slice at idle priority under the node's one share of its processors:
|
||||
// that quota bounds the total. Threads only size each step: the share the composer gives (buildstep.NodeLimits) over
|
||||
// this module's own capacity, so a step does not wait in the kernel's throttle. Without the composer's share there is
|
||||
// no slice to size a step to, and no thread limit is set.
|
||||
|
||||
// cpuLimits is what one step is held to now. Without the composer's words, it assumes every build seat of the node
|
||||
// beside it at this module's own capacity.
|
||||
// cpuLimits is what one step is held to now.
|
||||
func (m *Module) cpuLimits() buildcpu.Limits {
|
||||
slots := 1
|
||||
switch {
|
||||
@@ -24,7 +23,7 @@ func (m *Module) cpuLimits() buildcpu.Limits {
|
||||
return buildstep.NodeLimits(slots)
|
||||
}
|
||||
|
||||
// threadEnv is the environment every command of a step is given for its threads: GOMAXPROCS for esbuild and every Go
|
||||
// threadEnv is the environment (nothing without a share) every command of a step is given for its threads: GOMAXPROCS for esbuild and every Go
|
||||
// program, UV_THREADPOOL_SIZE for Node's worker pool.
|
||||
func (m *Module) threadEnv() []string {
|
||||
return buildcpu.Env(m.cpuLimits().Threads)
|
||||
|
||||
Reference in New Issue
Block a user