Repository navigation
Conversation
Collaborator
|
Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
kotauskas
force-pushed
the
nice-bootstrap
branch
from
November 9, 2026 16:25
2214019 to
21af44c
Compare
Member
|
This is already implemented in the Rust part of bootstrap, but conditionally: Line 479 in fefe61b |
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 19, 2026
bootstrap: Make low priority the default The `low-priority` option is tucked away so far in `bootstrap.example.toml` that it's nearly impossible to discover by anyone who doesn't think they're doing anything niche (see #165702). However, it is beneficial to have it enabled on nearly every system, since a build is a CPU-saturating batch job that has no business preempting foreground applications, which predominantly have nice 0. Consider the following three scenarios ensuing from the change from `low-priority = "false"` to `low-priority = "true"`: - There are no processes with non-negligible CPU usage between nice 0 and 10, and bootstrap builds do not get preempted by anything. A system on which this is the case will be unaffected by this change. Examples include CI runners and other build environments with proper build queuing. - There are foreground processes between nice 0 and 10 that are relatively light on CPU compared to a bootstrap build and were previously being heavily preempted by bootstrap builds. With this change, a system on which this is the case will see a significant improvement to the latency of interactive programs, enabling the user to comfortably do other things while the build is running without affecting the throughput of the build itself (as the programs are, as established above, light on CPU). - There are CPU-intensive but not CPU-saturating foreground processes (games, office and productivity software, Jupyter notebooks, etc.) between nice 0 and 10 that constantly compete with bootstrap builds for CPU time. With this change, a system on which this is the case will see CPU time allocation be biased toward the foreground CPU work at the expense of the build, which is most likely what the user wants, since they wouldn't run CPU-intensive things in the foreground if they didn't want them to have priority over background batch jobs whose completion they are passively waiting for. - There are CPU-saturating batch jobs between nice 0 and 10 that constantly compete with bootstrap builds for CPU time, interfering with each other and performing worse than if a batch job queue was in operation and one job ran after the other. With this change, a system on which this is the case will see the bootstrap build receive less CPU time, but the overall sum of batch jobs will complete in approximately the same amount of time regardless, and may even complete sooner due to reduced competition for CPU cache and OS page cache. In any case, this is a misconfigured and a priori suboptimally performing setup, and it will not see good performance unless some form of job queuing is implemented. Admins may implement a `low-priority = "false"` override as a hacky stopgap if it is desirable for the bootstrap build to engage in disruptive competition for resources and win against some other batch job running in parallel. Some may wonder why agonizing over this is necessary to begin with if this is such a clear-cut case that operating systems are supposed to deal with automatically. The answer is that the operating systems of today are still not very good at making this sort of scheduling decision in that their capacity to implement such logic automatically is limited and non-robust in unintuitive ways. For example, the automatic prioritization of foreground programs for scheduling purposes in Windows, known as [quantum boosting][quantboost], can only confer priority boosts to the threads of the process that owns a foreground window, which means that if the graphical application displayed within that window has an IPC dependency on a different process (as is the case with the likes of Jupyter notebooks and even regular web browsers), that dependency will not receive the quantum boost or any other kind of priority increase. [quantboost]: https://web.archive.org/web/20250326185947/https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7 On Linux, meanwhile, no such heuristics exist to begin with (due to graphical applications not holding any special status in the scheduler), and the only mechanism to prevent CPU-intensive and CPU-saturating batch jobs from preempting foreground applications is the emergent heuristic of completely fair scheduling, in which tasks with less total CPU time accrued will have higher priority. This is even more flawed than quantum boosting on Windows, as long-running graphical applications will easily get preempted for long periods of time by the constantly spawning rustc processes of a build that have no history of high CPU usage. In summary: there are commonly occurring setups on which this change is beneficial, commonly occurring setups on which this change does nothing, and extremely niche and typically broken use cases where this change does something that cannot be conclusively deemed positive or negative.
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Nov 20, 2026
…lubby789 bootstrap: Make low priority the default The `low-priority` option is tucked away so far in `bootstrap.example.toml` that it's nearly impossible to discover by anyone who doesn't think they're doing anything niche (see rust-lang#165702). However, it is beneficial to have it enabled on nearly every system, since a build is a CPU-saturating batch job that has no business preempting foreground applications, which predominantly have nice 0. Consider the following four scenarios ensuing from the change from `low-priority = "false"` to `low-priority = "true"`: - There are no processes with non-negligible CPU usage between nice 0 and 10, and bootstrap builds do not get preempted by anything. A system on which this is the case will be unaffected by this change. Examples include CI runners and other build environments with proper build queuing. - There are foreground processes between nice 0 and 10 that are relatively light on CPU compared to a bootstrap build and were previously being heavily preempted by bootstrap builds. With this change, a system on which this is the case will see a significant improvement to the latency of interactive programs, enabling the user to comfortably do other things while the build is running without affecting the throughput of the build itself (as the programs are, as established above, light on CPU). - There are CPU-intensive but not CPU-saturating foreground processes (games, office and productivity software, Jupyter notebooks, etc.) between nice 0 and 10 that constantly compete with bootstrap builds for CPU time. With this change, a system on which this is the case will see CPU time allocation be biased toward the foreground CPU work at the expense of the build, which is most likely what the user wants, since they wouldn't run CPU-intensive things in the foreground if they didn't want them to have priority over background batch jobs whose completion they are passively waiting for. - There are CPU-saturating batch jobs between nice 0 and 10 that constantly compete with bootstrap builds for CPU time, interfering with each other and performing worse than if a batch job queue was in operation and one job ran after the other. With this change, a system on which this is the case will see the bootstrap build receive less CPU time, but the overall sum of batch jobs will complete in approximately the same amount of time regardless, and may even complete sooner due to reduced competition for CPU cache and OS page cache. In any case, this is a misconfigured and a priori suboptimally performing setup, and it will not see good performance unless some form of job queuing is implemented. Admins may implement a `low-priority = "false"` override as a hacky stopgap if it is desirable for the bootstrap build to engage in disruptive competition for resources and win against some other batch job running in parallel. Some may wonder why agonizing over this is necessary to begin with if this is such a clear-cut case that operating systems are supposed to deal with automatically. The answer is that the operating systems of today are still not very good at making this sort of scheduling decision in that their capacity to implement such logic automatically is limited and non-robust in unintuitive ways. For example, the automatic prioritization of foreground programs for scheduling purposes in Windows, known as [quantum boosting][quantboost], can only confer priority boosts to the threads of the process that owns a foreground window, which means that if the graphical application displayed within that window has an IPC dependency on a different process (as is the case with the likes of Jupyter notebooks and even regular web browsers), that dependency will not receive the quantum boost or any other kind of priority increase. [quantboost]: https://web.archive.org/web/20250326185947/https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7 On Linux, meanwhile, no such heuristics exist to begin with (due to graphical applications not holding any special status in the scheduler), and the only mechanism to prevent CPU-intensive and CPU-saturating batch jobs from preempting foreground applications is the emergent heuristic of completely fair scheduling, in which tasks with less total CPU time accrued will have higher priority. This is even more flawed than quantum boosting on Windows, as long-running graphical applications will easily get preempted for long periods of time by the constantly spawning rustc processes of a build that have no history of high CPU usage. In summary: there are commonly occurring setups on which this change is beneficial, commonly occurring setups on which this change does nothing, and extremely niche and typically broken use cases where this change does something that cannot be conclusively deemed positive or negative.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 20, 2026
…lubby789 bootstrap: Make low priority the default The `low-priority` option is tucked away so far in `bootstrap.example.toml` that it's nearly impossible to discover by anyone who doesn't think they're doing anything niche (see rust-lang#165702). However, it is beneficial to have it enabled on nearly every system, since a build is a CPU-saturating batch job that has no business preempting foreground applications, which predominantly have nice 0. Consider the following four scenarios ensuing from the change from `low-priority = "false"` to `low-priority = "true"`: - There are no processes with non-negligible CPU usage between nice 0 and 10, and bootstrap builds do not get preempted by anything. A system on which this is the case will be unaffected by this change. Examples include CI runners and other build environments with proper build queuing. - There are foreground processes between nice 0 and 10 that are relatively light on CPU compared to a bootstrap build and were previously being heavily preempted by bootstrap builds. With this change, a system on which this is the case will see a significant improvement to the latency of interactive programs, enabling the user to comfortably do other things while the build is running without affecting the throughput of the build itself (as the programs are, as established above, light on CPU). - There are CPU-intensive but not CPU-saturating foreground processes (games, office and productivity software, Jupyter notebooks, etc.) between nice 0 and 10 that constantly compete with bootstrap builds for CPU time. With this change, a system on which this is the case will see CPU time allocation be biased toward the foreground CPU work at the expense of the build, which is most likely what the user wants, since they wouldn't run CPU-intensive things in the foreground if they didn't want them to have priority over background batch jobs whose completion they are passively waiting for. - There are CPU-saturating batch jobs between nice 0 and 10 that constantly compete with bootstrap builds for CPU time, interfering with each other and performing worse than if a batch job queue was in operation and one job ran after the other. With this change, a system on which this is the case will see the bootstrap build receive less CPU time, but the overall sum of batch jobs will complete in approximately the same amount of time regardless, and may even complete sooner due to reduced competition for CPU cache and OS page cache. In any case, this is a misconfigured and a priori suboptimally performing setup, and it will not see good performance unless some form of job queuing is implemented. Admins may implement a `low-priority = "false"` override as a hacky stopgap if it is desirable for the bootstrap build to engage in disruptive competition for resources and win against some other batch job running in parallel. Some may wonder why agonizing over this is necessary to begin with if this is such a clear-cut case that operating systems are supposed to deal with automatically. The answer is that the operating systems of today are still not very good at making this sort of scheduling decision in that their capacity to implement such logic automatically is limited and non-robust in unintuitive ways. For example, the automatic prioritization of foreground programs for scheduling purposes in Windows, known as [quantum boosting][quantboost], can only confer priority boosts to the threads of the process that owns a foreground window, which means that if the graphical application displayed within that window has an IPC dependency on a different process (as is the case with the likes of Jupyter notebooks and even regular web browsers), that dependency will not receive the quantum boost or any other kind of priority increase. [quantboost]: https://web.archive.org/web/20250326185947/https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7 On Linux, meanwhile, no such heuristics exist to begin with (due to graphical applications not holding any special status in the scheduler), and the only mechanism to prevent CPU-intensive and CPU-saturating batch jobs from preempting foreground applications is the emergent heuristic of completely fair scheduling, in which tasks with less total CPU time accrued will have higher priority. This is even more flawed than quantum boosting on Windows, as long-running graphical applications will easily get preempted for long periods of time by the constantly spawning rustc processes of a build that have no history of high CPU usage. In summary: there are commonly occurring setups on which this change is beneficial, commonly occurring setups on which this change does nothing, and extremely niche and typically broken use cases where this change does something that cannot be conclusively deemed positive or negative.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
Rollup merge of #165707 - kotauskas:low-prio-by-default, r=clubby789 bootstrap: Make low priority the default The `low-priority` option is tucked away so far in `bootstrap.example.toml` that it's nearly impossible to discover by anyone who doesn't think they're doing anything niche (see #165702). However, it is beneficial to have it enabled on nearly every system, since a build is a CPU-saturating batch job that has no business preempting foreground applications, which predominantly have nice 0. Consider the following four scenarios ensuing from the change from `low-priority = "false"` to `low-priority = "true"`: - There are no processes with non-negligible CPU usage between nice 0 and 10, and bootstrap builds do not get preempted by anything. A system on which this is the case will be unaffected by this change. Examples include CI runners and other build environments with proper build queuing. - There are foreground processes between nice 0 and 10 that are relatively light on CPU compared to a bootstrap build and were previously being heavily preempted by bootstrap builds. With this change, a system on which this is the case will see a significant improvement to the latency of interactive programs, enabling the user to comfortably do other things while the build is running without affecting the throughput of the build itself (as the programs are, as established above, light on CPU). - There are CPU-intensive but not CPU-saturating foreground processes (games, office and productivity software, Jupyter notebooks, etc.) between nice 0 and 10 that constantly compete with bootstrap builds for CPU time. With this change, a system on which this is the case will see CPU time allocation be biased toward the foreground CPU work at the expense of the build, which is most likely what the user wants, since they wouldn't run CPU-intensive things in the foreground if they didn't want them to have priority over background batch jobs whose completion they are passively waiting for. - There are CPU-saturating batch jobs between nice 0 and 10 that constantly compete with bootstrap builds for CPU time, interfering with each other and performing worse than if a batch job queue was in operation and one job ran after the other. With this change, a system on which this is the case will see the bootstrap build receive less CPU time, but the overall sum of batch jobs will complete in approximately the same amount of time regardless, and may even complete sooner due to reduced competition for CPU cache and OS page cache. In any case, this is a misconfigured and a priori suboptimally performing setup, and it will not see good performance unless some form of job queuing is implemented. Admins may implement a `low-priority = "false"` override as a hacky stopgap if it is desirable for the bootstrap build to engage in disruptive competition for resources and win against some other batch job running in parallel. Some may wonder why agonizing over this is necessary to begin with if this is such a clear-cut case that operating systems are supposed to deal with automatically. The answer is that the operating systems of today are still not very good at making this sort of scheduling decision in that their capacity to implement such logic automatically is limited and non-robust in unintuitive ways. For example, the automatic prioritization of foreground programs for scheduling purposes in Windows, known as [quantum boosting][quantboost], can only confer priority boosts to the threads of the process that owns a foreground window, which means that if the graphical application displayed within that window has an IPC dependency on a different process (as is the case with the likes of Jupyter notebooks and even regular web browsers), that dependency will not receive the quantum boost or any other kind of priority increase. [quantboost]: https://web.archive.org/web/20250326185947/https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7 On Linux, meanwhile, no such heuristics exist to begin with (due to graphical applications not holding any special status in the scheduler), and the only mechanism to prevent CPU-intensive and CPU-saturating batch jobs from preempting foreground applications is the emergent heuristic of completely fair scheduling, in which tasks with less total CPU time accrued will have higher priority. This is even more flawed than quantum boosting on Windows, as long-running graphical applications will easily get preempted for long periods of time by the constantly spawning rustc processes of a build that have no history of high CPU usage. In summary: there are commonly occurring setups on which this change is beneficial, commonly occurring setups on which this change does nothing, and extremely niche and typically broken use cases where this change does something that cannot be conclusively deemed positive or negative.
github-actions Bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Nov 23, 2026
bootstrap: Make low priority the default The `low-priority` option is tucked away so far in `bootstrap.example.toml` that it's nearly impossible to discover by anyone who doesn't think they're doing anything niche (see rust-lang/rust#165702). However, it is beneficial to have it enabled on nearly every system, since a build is a CPU-saturating batch job that has no business preempting foreground applications, which predominantly have nice 0. Consider the following four scenarios ensuing from the change from `low-priority = "false"` to `low-priority = "true"`: - There are no processes with non-negligible CPU usage between nice 0 and 10, and bootstrap builds do not get preempted by anything. A system on which this is the case will be unaffected by this change. Examples include CI runners and other build environments with proper build queuing. - There are foreground processes between nice 0 and 10 that are relatively light on CPU compared to a bootstrap build and were previously being heavily preempted by bootstrap builds. With this change, a system on which this is the case will see a significant improvement to the latency of interactive programs, enabling the user to comfortably do other things while the build is running without affecting the throughput of the build itself (as the programs are, as established above, light on CPU). - There are CPU-intensive but not CPU-saturating foreground processes (games, office and productivity software, Jupyter notebooks, etc.) between nice 0 and 10 that constantly compete with bootstrap builds for CPU time. With this change, a system on which this is the case will see CPU time allocation be biased toward the foreground CPU work at the expense of the build, which is most likely what the user wants, since they wouldn't run CPU-intensive things in the foreground if they didn't want them to have priority over background batch jobs whose completion they are passively waiting for. - There are CPU-saturating batch jobs between nice 0 and 10 that constantly compete with bootstrap builds for CPU time, interfering with each other and performing worse than if a batch job queue was in operation and one job ran after the other. With this change, a system on which this is the case will see the bootstrap build receive less CPU time, but the overall sum of batch jobs will complete in approximately the same amount of time regardless, and may even complete sooner due to reduced competition for CPU cache and OS page cache. In any case, this is a misconfigured and a priori suboptimally performing setup, and it will not see good performance unless some form of job queuing is implemented. Admins may implement a `low-priority = "false"` override as a hacky stopgap if it is desirable for the bootstrap build to engage in disruptive competition for resources and win against some other batch job running in parallel. Some may wonder why agonizing over this is necessary to begin with if this is such a clear-cut case that operating systems are supposed to deal with automatically. The answer is that the operating systems of today are still not very good at making this sort of scheduling decision in that their capacity to implement such logic automatically is limited and non-robust in unintuitive ways. For example, the automatic prioritization of foreground programs for scheduling purposes in Windows, known as [quantum boosting][quantboost], can only confer priority boosts to the threads of the process that owns a foreground window, which means that if the graphical application displayed within that window has an IPC dependency on a different process (as is the case with the likes of Jupyter notebooks and even regular web browsers), that dependency will not receive the quantum boost or any other kind of priority increase. [quantboost]: https://web.archive.org/web/20250326185947/https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7 On Linux, meanwhile, no such heuristics exist to begin with (due to graphical applications not holding any special status in the scheduler), and the only mechanism to prevent CPU-intensive and CPU-saturating batch jobs from preempting foreground applications is the emergent heuristic of completely fair scheduling, in which tasks with less total CPU time accrued will have higher priority. This is even more flawed than quantum boosting on Windows, as long-running graphical applications will easily get preempted for long periods of time by the constantly spawning rustc processes of a build that have no history of high CPU usage. In summary: there are commonly occurring setups on which this change is beneficial, commonly occurring setups on which this change does nothing, and extremely niche and typically broken use cases where this change does something that cannot be conclusively deemed positive or negative.
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.
Reduces disruption to system responsiveness while an
./x bis running. I initially wanted to add a Windows branch as well and maybe also reduce I/O priority on supported platforms, but it seems like you can't do that in Python without pulling in large dependencies or reinventing the wheel.Large language models were not used in the production of this PR.