-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Eliminate global lock in allocation path #3472
Comments
It might additionally be nice to have pluggable allocation strategies (in some sense - at least for comparing options). So far we've mostly been assuming that simply plugging in jemalloc or tcmalloc will be sufficient for most uses, since they do very smart things with multithreading, but there's a lot of opportunity for experimenting here. |
I have heard tell that concurrent allocators also exist which can avoid locking in fast-paths. Definitely worth a look. |
My intention is to make the local heap (and probably the stack) use a general The page pool should suffice for most values and will permit mostly-copying |
Removing 0.7 milestone. I don't think this will happen before 1.0 |
nominating production ready |
accepted for production-ready milestone |
Updated title to reflect the fact that the global lock is bad, but there are many possible solutions beyond making distinct per-task heaps: just using jemalloc probably gets us most of the same perf wins, for example. |
I also believe that it will be hard to beat just using jemalloc everywhere. |
I think jemalloc is mostly free of locks because once your allocations are larger than the thread-local arenas you start hitting |
jemalloc is re-enabled, so I think we can consider this a non-issue the only potential issue is with large allocations on non-Linux platforms, but we would need hard numbers to verify if that's the case and the garbage collector will provide a local heap anyway (eventually) |
…config Add option to print current config to stdout
deadlock: show backtrace for all threads Fixes rust-lang/miri#3424
Currently, I believe @ and ~ are represented by allocating on the same literal heap at runtime. Creating a new private heap for each task for @-allocations would let tasks avoid hitting a global lock for every allocation.
Global locking is an important consideration for massively-parallel computation, and providing a way to avoid it while still allowing dynamic memory allocation would be seriously attractive to the multicore programming world. (It would also provide more motivation to use @-vectors!)
The text was updated successfully, but these errors were encountered: