Skip to content

Commit d7f1656

Browse files
committed
many-seeds: do not use more than 8 threads
1 parent 4ce50a3 commit d7f1656

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tools/miri/src/bin/miri.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,9 @@ fn main() {
723723

724724
// Ensure we have parallelism for many-seeds mode.
725725
if many_seeds.is_some() && !rustc_args.iter().any(|arg| arg.starts_with("-Zthreads=")) {
726-
rustc_args.push(format!(
727-
"-Zthreads={}",
728-
std::thread::available_parallelism().map_or(1, |n| n.get())
729-
));
726+
// Clamp to 8 threads; things get a lot less efficient beyond that due to lock contention.
727+
let threads = std::thread::available_parallelism().map_or(1, |n| n.get()).min(8);
728+
rustc_args.push(format!("-Zthreads={threads}"));
730729
}
731730
let many_seeds =
732731
many_seeds.map(|seeds| ManySeedsConfig { seeds, keep_going: many_seeds_keep_going });

0 commit comments

Comments
 (0)