-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only work-steal in the main loop #12
base: rustc
Are you sure you want to change the base?
Conversation
The regression looks regrettable, and it will probably prevent us from landing parallel rustc. I would like us to decide whether to work-stealing by querying dependencies instead of prohibiting it in inner loops. I hope we can left this change and try other implementations first. |
0481924
to
a0a8c45
Compare
By increasing the thread count we can increase the work stealing done and thus reduce the regression:
|
@cuviper Would you be up for reviewing this? |
Hello! Do you have any tips on currently triggering those bugs? |
I haven't had time to review this in depth -- but seeing how many deep areas it needs to change, along with existing patches diverging from rayon, I'm starting to think that we would be better off with a bespoke |
I am currently working on this and other parallelization issues. |
@Zoxc wouldn't that mess up with the jobserver? It raises the limit of number cores used in parallel. |
Yeah, this does seem to imply a move away from tracking Rayon. This approach doesn't match well with Rayon iterators and we may want to introduce fibers too. I'd like to see some more extensive testing to verify this solves the deadlock issues before moving further in this direction though.
Not sure what you mean here? The jobserver would still limit active threads across cores as before. |
This PR removes work stealing from other threads, except when in the main loop. This avoids situations where we steal work we can't complete due to waiting on queries. This should fix bugs like rust-lang/rust#111521 and rust-lang/rust#115223, but it does have a negative performance impact.
Tests for 6 threads: