diff options
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | nptl/pthread_create.c | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/arm/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/lowlevellock.h | 15 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/microblaze/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/lowlevellock.h | 12 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/lowlevellock.h | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sh/lowlevellock.h | 15 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/tile/lowlevellock.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/lowlevellock.h | 14 |
17 files changed, 21 insertions, 158 deletions
diff --git a/ChangeLog b/ChangeLog index 0bd02c4d09..a5bc6025a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2014-07-10 Roland McGrath <roland@hack.frob.com> + * nptl/pthread_create.c (start_thread): Use atomic_or and + lll_futex_wake directly rather than lll_robust_dead. + * sysdeps/unix/sysv/linux/aarch64/lowlevellock.h + (lll_robust_dead): Macro removed. + * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/arm/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/mips/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. + * nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock): Use atomic_compare_and_exchange_val_acq directly rather than lll_robust_trylock. diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 2997163733..b9af010767 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -390,7 +390,8 @@ start_thread (void *arg) # endif this->__list.__next = NULL; - lll_robust_dead (this->__lock, /* XYZ */ LLL_SHARED); + atomic_or (&this->__lock, FUTEX_OWNER_DIED); + lll_futex_wake (this->__lock, 1, /* XYZ */ LLL_SHARED); } while (robust != (void *) &pd->robust_head); } diff --git a/sysdeps/unix/sysv/linux/aarch64/lowlevellock.h b/sysdeps/unix/sysv/linux/aarch64/lowlevellock.h index 0e61f18bf9..2acebd4201 100644 --- a/sysdeps/unix/sysv/linux/aarch64/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/aarch64/lowlevellock.h @@ -111,15 +111,6 @@ __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/alpha/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/lowlevellock.h index 584094f780..bd727621ad 100644 --- a/sysdeps/unix/sysv/linux/alpha/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/alpha/lowlevellock.h @@ -113,15 +113,6 @@ INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/arm/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/lowlevellock.h index 58699718a1..3199d0a5d6 100644 --- a/sysdeps/unix/sysv/linux/arm/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/arm/lowlevellock.h @@ -110,15 +110,6 @@ __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h index 426984f08f..fb61d0c6d0 100644 --- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h @@ -144,15 +144,6 @@ typedef int lll_lock_t; __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h index 02ec8f7e7e..9d9ae587ed 100644 --- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -377,21 +377,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count, }) -#define lll_robust_dead(futex, private) \ - (void) \ - ({ int __ignore; \ - register int _nr asm ("edx") = 1; \ - __asm __volatile (LOCK_INSTR "orl %5, (%2)\n\t" \ - LLL_EBX_LOAD \ - LLL_ENTER_KERNEL \ - LLL_EBX_LOAD \ - : "=a" (__ignore) \ - : "0" (SYS_futex), LLL_EBX_REG (&(futex)), \ - "c" (__lll_private_flag (FUTEX_WAKE, private)), \ - "d" (_nr), "i" (FUTEX_OWNER_DIED), \ - "i" (offsetof (tcbhead_t, sysinfo))); \ - }) - #define lll_islocked(futex) \ (futex != LLL_LOCK_INITIALIZER) diff --git a/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h index 845a1533d1..e84f530834 100644 --- a/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h @@ -110,16 +110,6 @@ _r10 == -1 ? -_retval : _retval; \ }) -#define lll_robust_dead(futexv, private) \ -do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - DO_INLINE_SYSCALL(futex, 3, (long) __futexp, \ - __lll_private_flag (FUTEX_WAKE, private), 1); \ - } \ -while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/m68k/lowlevellock.h b/sysdeps/unix/sysv/linux/m68k/lowlevellock.h index 5ab5218721..3b40449ac0 100644 --- a/sysdeps/unix/sysv/linux/m68k/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/m68k/lowlevellock.h @@ -112,15 +112,6 @@ __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h index 0de3e892c3..0ba63a1e87 100644 --- a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h @@ -112,15 +112,6 @@ __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/mips/lowlevellock.h b/sysdeps/unix/sysv/linux/mips/lowlevellock.h index f984c08e44..9ed6338ae6 100644 --- a/sysdeps/unix/sysv/linux/mips/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/mips/lowlevellock.h @@ -110,15 +110,6 @@ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h index 4af4a8206c..d7e1e38cc6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -114,18 +114,6 @@ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - INTERNAL_SYSCALL_DECL (__err); \ - int *__futexp = &(futexv); \ - \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - INTERNAL_SYSCALL (futex, __err, 4, __futexp, \ - __lll_private_flag (FUTEX_WAKE, private), 1, 0); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 0bc641124c..eaf2d58ee9 100644 --- a/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -107,16 +107,6 @@ (nr), 0); \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ diff --git a/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/sysdeps/unix/sysv/linux/sh/lowlevellock.h index fe8374e233..10a2c25245 100644 --- a/sysdeps/unix/sysv/linux/sh/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/sh/lowlevellock.h @@ -301,21 +301,6 @@ extern int __lll_unlock_wake (int *__futex, int private) attribute_hidden; if (__result) \ __lll_unlock_wake (__futex, private); }) -#define lll_robust_dead(futex, private) \ - (void) ({ int __ignore, *__futex = &(futex); \ - __asm __volatile ("\ - .align 2\n\ - mova 1f,r0\n\ - mov r15,r1\n\ - mov #-6,r15\n\ - 0: mov.l @%1,%0\n\ - or %2,%0\n\ - mov.l %0,@%1\n\ - 1: mov r1,r15"\ - : "=&r" (__ignore) : "r" (__futex), "r" (FUTEX_OWNER_DIED) \ - : "r0", "r1", "memory"); \ - lll_futex_wake (__futex, 1, private); }) - # ifdef NEED_SYSCALL_INST_PAD # define SYSCALL_WITH_INST_PAD "\ trapa #0x14; or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0" diff --git a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h index 015af35d28..d764075fdb 100644 --- a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h @@ -132,15 +132,6 @@ extern void __cpu_relax (void); INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #ifdef __sparc32_atomic_do_lock /* Avoid FUTEX_WAKE_OP if supporting pre-v9 CPUs. */ diff --git a/sysdeps/unix/sysv/linux/tile/lowlevellock.h b/sysdeps/unix/sysv/linux/tile/lowlevellock.h index 09c1b3d7e7..e3e52a48f0 100644 --- a/sysdeps/unix/sysv/linux/tile/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/tile/lowlevellock.h @@ -109,15 +109,6 @@ (nr), 0); \ }) -#define lll_robust_dead(futexv, private) \ - do \ - { \ - int *__futexp = &(futexv); \ - atomic_or (__futexp, FUTEX_OWNER_DIED); \ - lll_futex_wake (__futexp, 1, private); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h index c93c68e64f..55b4e16144 100644 --- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -378,20 +378,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count, } \ while (0) -#define lll_robust_dead(futex, private) \ - do \ - { \ - int ignore; \ - __asm __volatile (LOCK_INSTR "orl %3, (%2)\n\t" \ - "syscall" \ - : "=m" (futex), "=a" (ignore) \ - : "D" (&(futex)), "i" (FUTEX_OWNER_DIED), \ - "S" (__lll_private_flag (FUTEX_WAKE, private)), \ - "1" (__NR_futex), "d" (1) \ - : "cx", "r11", "cc", "memory"); \ - } \ - while (0) - /* Returns non-zero if error happened, zero if success. */ #define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \ ({ int __res; \ |