Linux 6.17 Fixes A Performance Bottleneck In The Futex Code
([Linux Kernel] 3 Hours Ago
FUTEX)
- Reference: 0001567124
- News link: https://www.phoronix.com/news/Linux-6.17-FUTEX
- Source link:
Merged last week for [1]Linux 6.17 were the FUTEX locking changes that include addressing an observed performance bottleneck.
Prominent Linux engineer Peter Zijlstra at Intel adapted the FUTEX code to use a RCU-based, per-CPU reference counting to address a performance bottleneck found within the existing code that used a single instance variant.
Peter explained with [2]the patch addressing the FUTEX performance bottleneck:
"The use of rcuref_t for reference counting introduces a performance bottleneck when accessed concurrently by multiple threads during futex operations.
Replace rcuref_t with special crafted per-CPU reference counters. The lifetime logic remains the same.
The newly allocate private hash starts in FR_PERCPU state. In this state, each futex operation that requires the private hash uses a per-CPU counter (an unsigned int) for incrementing or decrementing the reference count."
The FUTEX improvements were merged last week to Linux 6.17 Git as part of the [3]locking/futex pull request.
[1] https://www.phoronix.com/search/Linux+6.17
[2] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=locking/futex&id=56180dd20c19e5b0fa34822997a9ac66b517e7b3
[3] https://lore.kernel.org/lkml/175377875605.620102.13731137828469256924.tglx@xen13.tec.linutronix.de/
Prominent Linux engineer Peter Zijlstra at Intel adapted the FUTEX code to use a RCU-based, per-CPU reference counting to address a performance bottleneck found within the existing code that used a single instance variant.
Peter explained with [2]the patch addressing the FUTEX performance bottleneck:
"The use of rcuref_t for reference counting introduces a performance bottleneck when accessed concurrently by multiple threads during futex operations.
Replace rcuref_t with special crafted per-CPU reference counters. The lifetime logic remains the same.
The newly allocate private hash starts in FR_PERCPU state. In this state, each futex operation that requires the private hash uses a per-CPU counter (an unsigned int) for incrementing or decrementing the reference count."
The FUTEX improvements were merged last week to Linux 6.17 Git as part of the [3]locking/futex pull request.
[1] https://www.phoronix.com/search/Linux+6.17
[2] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=locking/futex&id=56180dd20c19e5b0fa34822997a9ac66b517e7b3
[3] https://lore.kernel.org/lkml/175377875605.620102.13731137828469256924.tglx@xen13.tec.linutronix.de/
phoronix