]> git.ipfire.org Git - thirdparty/glibc.git/commit
Add runtime check for __ASSUME_REQUEUE_PI (BZ# 18463)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 17 May 2016 13:16:39 +0000 (10:16 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 3 Jun 2016 18:39:17 +0000 (15:39 -0300)
commitbb433427a5de00b74d308532c27dc18cc348e03f
treec7b9478c36298dac0d2cd5980754f1ccf93a2510
parent3501fea6908a747e4c9835228b4baaf06bc8e66b
Add runtime check for __ASSUME_REQUEUE_PI (BZ# 18463)

This patch adds a runtime check for requeue priority futexes
(FUTEX_{WAIT,CMP}_REQUEUE_PI) for configurations that do not define
__ASSUME_REQUEUE_PI.

It uses the same check uses for priority lock/unlock support, where
issuing a futex operation with FUTEX_UNLOCK_PI returns if kernel has
or not internal 'futex_cmpxchg_enabled' support (which is also used
on requeue priority futexes operations).

For architectures that already have __ASSUME_REQUEUE_PI the code
flow does not change, 'use_requeue_pi' returns the previous chec
logic.  Also, if 'futex_cmpxchg_enabled' is not supported by the
kernel, the previous logic will be used (by issuing a default futex
operation).

Tested on ARM (v3.8 kernel) and x86_64.

* nptl/pthreadP.h (prio_inherit_missing): Change name to
__prio_inherit_missing.
(USE_REQUEUE_PI): Remove define.
(use_requeue_pi): New function.
* nptl/pthread_cond_broadcast.c [__ASSUME_REQUEUE_PI]
(__pthread_cond_broadcast): Remove ifdef.
(USE_REQUEUE_PI): Change to use_requeue_pi.
* nptl/pthread_cond_signal.c [__ASSUME_REQUEUE_PI]
(__pthread_cond_signal): Remove ifdef.
(USE_REQUEUE_PI): Change to use_requeue_pi.
* nptl/pthread_cond_timedwait.c [__ASSUME_REQUEUE_PI]
(__pthread_cond_timedwait): Remove ifdef.
(USE_REQUEUE_PI): Change to use_requeue_pi.
( nptl/pthread_cond_wait.c [__ASSUME_REQUEUE_PI]
(__pthread_cond_wait): Remove ifdef.
(USE_REQUEUE_PI): Change to use_requeue_pi.
* nptl/pthread_mutex_init.c (prio_inherit_missing): Remove 'static'
qualifier and change name to __prio_inherit_missing.
ChangeLog
nptl/pthreadP.h
nptl/pthread_cond_broadcast.c
nptl/pthread_cond_signal.c
nptl/pthread_cond_timedwait.c
nptl/pthread_cond_wait.c
nptl/pthread_mutex_init.c