get rid of tcx in deadlock handler when parallel compilation#98570
get rid of tcx in deadlock handler when parallel compilation#98570bors merged 1 commit intorust-lang:masterfrom
tcx in deadlock handler when parallel compilation#98570Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
Thanks @SparrowLii. That's a great solution. |
Sure, made the corresponding changes. #[Edit] It's a bit difficult to remove it from the |
This comment has been minimized.
This comment has been minimized.
|
Umm.. seems that Just reverted the last change |
compiler/rustc_query_impl/src/lib.rs
Outdated
There was a problem hiding this comment.
Why is this pub required?
There was a problem hiding this comment.
We need to use try_collect_active_jobs and deadlock in rustc_interface::util::handle_deadlock. We can add pub use rustc_query_system::query::{deadlock, QueryContext} instead of pub the all thing here.
|
@bors r+ rollup=never |
|
📌 Commit fbca21e has been approved by |
|
If you're going to do significant work in An alternative way to fix #94654 would be to extend |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (8c52a83): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This is a very obscure and hard-to-trace problem that affects thread scheduling. If we copy
tcxto the deadlock handler thread, it will perform unpredictable behavior and cause very weird problems when executingtry_collect_active_jobs(For example, the deadlock handler thread suddenly preempts the content of the blocked worker thread and executes the unknown judgment branch, like #94654).Fortunately we can avoid this behavior by precomputing
query_map. This change fixes the following ui tests failure on my environment when setparallel-compiler = true:Updates #75760
Fixes #94654