Repository navigation
[9.2.0] Make local scheduling respect exec_properties resources - #29426
Merged
Conversation
…9284) Previously only tests supported a target level way to hint the resources required by the target. This is done with `tags = ["resources:cpu:10"]`. Now this syntax is supported for normal actions as well, and both normal actions and test actions support this same format in `exec_properties` with `exec_properties = {"resources:cpu": "10"}`, or exec_group specific versions like: `exec_properties = {"cpp_link.resources:cpu": "10"}`. Work towards bazelbuild#19679 (doesn't handle a default flag currently) Work towards bazelbuild#17368 Work towards bazelbuild#25770 Fixes bazelbuild#6477 Fixes bazelbuild#19805 Fixes bazelbuild#25195 Fixes bazelbuild#25792 Fixes bazelbuild#25793 RELNOTES[inc]: `exec_properties` now respects `resources:cpu` and `resources:memory` for local resource estimation. Closes bazelbuild#29284. Closes bazelbuild#29419 PiperOrigin-RevId: 906919034 Change-Id: Ia9effd70a71f4e1f42021d945cdc7b1d9d52bbf6 (cherry picked from commit d35da0e)
This was referenced Apr 29, 2026
katre
approved these changes
Apr 29, 2026
iancha1992
enabled auto-merge
April 29, 2026 21:08
meisterT
approved these changes
Apr 30, 2026
iancha1992
added this pull request to the merge queue
Apr 30, 2026
fhanau
added a commit
to cloudflare/workerd
that referenced
this pull request
Aug 14, 2026
Starting with Bazel 9.2.0, we can indicate expected resource usage for non-test actions (see bazelbuild/bazel#29426). This can be useful for link actions, which lld runs in parallel by default. Reserve 4 or 8 CPUs for link actions. This change is primarily useful for the downstream build, but the workerd build will also benefit from having fewer CPU usage spikes due to trying to link too many targets at once. Also limit lld's link parallelism since lld is slightly less efficient when linking with too many threads at once as discussed in https://reviews.llvm.org/D147493. Note that we deliberately apply a limit of 8 threads while only allocating 4 CPUs for most targets since lld usually doesn't reach the maximum allowed parallelism for long (i.e. average link CPU is expected to be well below 800% anyway).
fhanau
added a commit
to cloudflare/workerd
that referenced
this pull request
Aug 14, 2026
Starting with Bazel 9.2.0, we can indicate expected resource usage for non-test actions (see bazelbuild/bazel#29426). This can be useful for link actions, which lld runs in parallel by default. Reserve 4 or 8 CPUs for link actions. This change is primarily useful for the downstream build, but the workerd build will also benefit from having fewer CPU usage spikes due to trying to link too many targets at once. Also limit lld's link parallelism since lld is slightly less efficient when linking with too many threads at once as discussed in https://reviews.llvm.org/D147493. Note that we deliberately apply a limit of 8 threads while only allocating 4 CPUs for most targets since lld usually doesn't reach the maximum allowed parallelism for long (i.e. average link CPU is expected to be well below 800% anyway).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously only tests supported a target level way to hint the resources
required by the target. This is done with
tags = ["resources:cpu:10"].Now this syntax is supported for normal actions as well, and both normal
actions and test actions support this same format in
exec_propertieswith
exec_properties = {"resources:cpu": "10"}, or exec_group specificversions like:
exec_properties = {"cpp_link.resources:cpu": "10"}.Work towards #19679 (doesn't
handle a default flag currently)
Work towards #17368
Work towards #25770
Fixes #6477
Fixes #19805
Fixes #25195
Fixes #25792
Fixes #25793
RELNOTES[inc]:
exec_propertiesnow respectsresources:cpuandresources:memoryfor local resource estimation.Closes #29284.
Closes #29419
PiperOrigin-RevId: 906919034
Change-Id: Ia9effd70a71f4e1f42021d945cdc7b1d9d52bbf6
(cherry picked from commit d35da0e)