[ports] Use FUTEX_WAIT_BITSET for timed futex operations
Siddhesh Poyarekar
siddhesh@redhat.com
Mon Nov 5 16:51:00 GMT 2012
Hi,
The x86 implementations of these functions have long used
FUTEX_WAIT_BITSET instead of FUTEX_WAIT to wait in the futex system
call for timed operations like pthread_cond_timedwait,
pthread_rwlock_timed*lock and friends. FUTEX_WAIT_BITSET does not need
the additional computation of relative timeout in the function, which
gets converted back into an absolute timeout in the kernel. As a
result, FUTEX_WAIT_BITSET is faster than FUTEX_WAIT.
I just committed a change to s390 and ppc to make use of
FUTEX_WAIT_BITSET if it is available (linux 2.6.29 onwards):
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=8f861542dd0603bef99e126e509ece89514c1eeb
I did not make this change for other architectures since I did not have
access to a test machine to verify the change. So I request the arch
maintainers to implement the macro lll_futex_timed_wait_bitset in the
manner similar to that in the patch above so that the rest of the code
can then take advantage of the performance improvement due to
FUTEX_WAIT_BITSET for their architecture. Currently, if
lll_futex_timed_wait_bitset is not defined, the code simply selects
lll_futex_timed_wait instead, which is the old behaviour.
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list