Skip to content
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

Benchmark entirely unfair locks for parallel rustc #92596

Open
bjorn3 opened this issue Jan 5, 2022 · 0 comments
Open

Benchmark entirely unfair locks for parallel rustc #92596

bjorn3 opened this issue Jan 5, 2022 · 0 comments
Labels
A-parallel-queries Area: Parallel query execution WG-compiler-parallel Working group: Parallelizing the compiler

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 5, 2022

My theory is that the accounting necessary for implementing eventually fair locks in parking lot causes an instruction count increase for parallel rusrc by a couple of percents without improving the wall time. Without this accounting taking a lock should be a matter of a cmpxchg and possibly a futex wait if it was already locked. I don't think it matters as much if a thread is starved for extended periods of time rather than splitting this starving between threads as eventually the thread responsible for the starving will finish it's task and no longer cause any other threads to starve, thus guaranteeing progress. Whether I am right or not will need to be shown using benchmarking. It would also be interesting to see how long a spinlock should happen before falling back to a futex wait, if it should happen at all given that some query locks are probably held for extended periods of time.

@bjorn3 bjorn3 added A-parallel-queries Area: Parallel query execution WG-compiler-parallel Working group: Parallelizing the compiler labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parallel-queries Area: Parallel query execution WG-compiler-parallel Working group: Parallelizing the compiler
Projects
None yet
Development

No branches or pull requests

1 participant