Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false sharing issue between main thread and io-threads when acces…
…s `used_memory_thread`. (#1179) When profiling some workloads with `io-threads` enabled. We found the false sharing issue is heavy. This patch try to split the the elements accessed by main thread and io-threads into different cache line by padding the elements in the head of `used_memory_thread_padded` array. This design helps mitigate the false sharing between main thread and io-threads, because the main thread has been the bottleneck with io-threads enabled. We didn't put each element in an individual cache line is that we don't want to bring the additional cache line fetch operation (3 vs 16 cache line) when call function like `zmalloc_used_memory()`. --------- Signed-off-by: Lipeng Zhu <[email protected]> Signed-off-by: Lipeng Zhu <[email protected]> Signed-off-by: Viktor Söderqvist <[email protected]> Co-authored-by: Wangyang Guo <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
- Loading branch information