[PartitionAlloc] Replace SpinLock with a spinning lock on Linux kernels.
PartitionAlloc's main lock is the per-PartitionRoot lock. It has to be fast on the common uncontended path, and better than a simple spinlock when it's contended. Past attempts to replace it with base::Lock regressed low and high-level benchmarks. This commit introduces SpinningFutex, a futex()-based lock which spins in userspace like SpinLock before calling into the kernel, like base::Lock does. It is intended to be as fast as SpinLock, but better for contended cases. Since it relies on the linux-specific futex() system call, this is only available on Linux-based kernels, for now. Bug: 1125866, 1125999, 1061437 Change-Id: I1e0cf23beb48c32518d0ffc293d1a9326bc2d7bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409902 Commit-Queue: Benoit L <lizeb@chromium.org> Reviewed-by:Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#808343}
Showing
Please register or sign in to comment