public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [ports] Use FUTEX_WAIT_BITSET for timed futex operations
@ 2012-11-05 16:51 Siddhesh Poyarekar
  0 siblings, 0 replies; only message in thread
From: Siddhesh Poyarekar @ 2012-11-05 16:51 UTC (permalink / raw)
  To: libc-ports; +Cc: libc-alpha

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05 16:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 16:51 [ports] Use FUTEX_WAIT_BITSET for timed futex operations Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).