You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah very interesting. I have not seen that before and will take a close look -- it would be great if it can be used to avoid some CAS instructions and find further perf improvements. Thanks for the links!
To avoid CAS I think you would need to have approximately N^2 thread free lists, one for each possible pairing of threads. With restartable sequences you can have per cpu free lists. This could lead to less wasted heap space. It's also possible that the N in N^2 becomes small enough (number of CPU cores) that it's feasible to use CAS free spsc queues instead of the current mpsc for cross-thread frees.
Activity
daanx commentedon Oct 14, 2020
Ah very interesting. I have not seen that before and will take a close look -- it would be great if it can be used to avoid some CAS instructions and find further perf improvements. Thanks for the links!
rigtorp commentedon Oct 16, 2020
To avoid CAS I think you would need to have approximately N^2 thread free lists, one for each possible pairing of threads. With restartable sequences you can have per cpu free lists. This could lead to less wasted heap space. It's also possible that the N in N^2 becomes small enough (number of CPU cores) that it's feasible to use CAS free spsc queues instead of the current mpsc for cross-thread frees.
Great work creating mimalloc! It's a very promising allocator and good to see some innovation on heap allocators. I particularly like the great huge page support, it's really easy to use: https://rigtorp.se/hugepages/ (Last section, scroll to the end).
rigtorp commentedon Oct 16, 2020
I found this very detailed explanation on how tcmalloc uses rseq for per cpu free lists: https://google.github.io/tcmalloc/rseq.html