This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.10-177-g32c6c34
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 19 Jul 2009 04:54:18 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.10-177-g32c6c34
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 32c6c342b6bc10396785a4542c22f6f95deca684 (commit)
via 4c74e6522a9e6e9c0ae921e3150bf735cfeb67b0 (commit)
via d979611eb9f18ead1b8da3e956b941545f682565 (commit)
from d9201c13656dc73fba9c5f5f96c3d0e2c7971218 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=32c6c342b6bc10396785a4542c22f6f95deca684
commit 32c6c342b6bc10396785a4542c22f6f95deca684
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sat Jul 18 21:53:26 2009 -0700
Extend x86-64 pthread_rwlock_timedrdlock to use futex syscall with absolute timeout.
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 719d781..44f9846 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -3,6 +3,8 @@
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
(pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
directly use absolute timeout.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+ (pthread_rwlock_timedrdlock): Likewise.
* tst-cond11.c (run_test): Add test to check that the timeout is
long enough.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index 366c96f..23b218a 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -36,16 +36,21 @@ pthread_rwlock_timedrdlock:
cfi_startproc
pushq %r12
cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%r12, 0)
pushq %r13
cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%r13, 0)
+#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
+# define VALREG %edx
+#else
pushq %r14
cfi_adjust_cfa_offset(8)
- cfi_offset(%r12, -16)
- cfi_offset(%r13, -24)
- cfi_offset(%r14, -32)
+ cfi_rel_offset(%r14, 0)
subq $16, %rsp
cfi_adjust_cfa_offset(16)
+# define VALREG %r14d
+#endif
movq %rdi, %r12
movq %rsi, %r13
@@ -76,7 +81,7 @@ pthread_rwlock_timedrdlock:
incl READERS_QUEUED(%r12)
je 4f
- movl READERS_WAKEUP(%r12), %r14d
+ movl READERS_WAKEUP(%r12), VALREG
/* Unlock. */
LOCK
@@ -87,8 +92,33 @@ pthread_rwlock_timedrdlock:
#endif
jne 10f
+11:
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+# ifdef PIC
+ cmpl $0, __have_futex_clock_realtime(%rip)
+# else
+ cmpl $0, __have_futex_clock_realtime
+# endif
+ je .Lreltmo
+#endif
+
+ movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %esi
+ xorl PSHARED(%r12), %esi
+ movq %r13, %r10
+ movl $0xffffffff, %r9d
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+ movl %r14d, %edx
+#endif
+21: leaq READERS_WAKEUP(%r12), %rdi
+ movl $SYS_futex, %eax
+ syscall
+ movq %rax, %rdx
+
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+ .subsection 2
+.Lreltmo:
/* Get current time. */
-11: movq %rsp, %rdi
+ movq %rsp, %rdi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
callq *%rax
@@ -111,27 +141,26 @@ pthread_rwlock_timedrdlock:
movq %rcx, (%rsp) /* Store relative timeout. */
movq %rdi, 8(%rsp)
-#ifdef __ASSUME_PRIVATE_FUTEX
+# ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
xorl PSHARED(%r12), %esi
-#else
-# if FUTEX_WAIT == 0
- movl PSHARED(%r12), %esi
# else
+# if FUTEX_WAIT == 0
+ movl PSHARED(%r12), %esi
+# else
movl $FUTEX_WAIT, %esi
orl PSHARED(%r12), %esi
-# endif
+# endif
xorl %fs:PRIVATE_FUTEX, %esi
-#endif
+# endif
movq %rsp, %r10
movl %r14d, %edx
- leaq READERS_WAKEUP(%r12), %rdi
- movl $SYS_futex, %eax
- syscall
- movq %rax, %rdx
-17:
- /* Reget the lock. */
+ jmp 21b
+ .previous
+#endif
+
+17: /* Reget the lock. */
movl $1, %esi
xorl %eax, %eax
LOCK
@@ -163,11 +192,13 @@ pthread_rwlock_timedrdlock:
7: movq %rdx, %rax
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
addq $16, %rsp
cfi_adjust_cfa_offset(-16)
popq %r14
cfi_adjust_cfa_offset(-8)
cfi_restore(%r14)
+#endif
popq %r13
cfi_adjust_cfa_offset(-8)
cfi_restore(%r13)
@@ -176,10 +207,16 @@ pthread_rwlock_timedrdlock:
cfi_restore(%r12)
retq
+#ifdef __ASSUME_PRIVATE_FUTEX
+ cfi_adjust_cfa_offset(16)
+ cfi_rel_offset(%r12, 8)
+ cfi_rel_offset(%r13, 0)
+#else
cfi_adjust_cfa_offset(40)
cfi_offset(%r12, -16)
cfi_offset(%r13, -24)
cfi_offset(%r14, -32)
+#endif
1: movl PSHARED(%rdi), %esi
#if MUTEX != 0
addq $MUTEX, %rdi
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4c74e6522a9e6e9c0ae921e3150bf735cfeb67b0
commit 4c74e6522a9e6e9c0ae921e3150bf735cfeb67b0
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sat Jul 18 21:41:52 2009 -0700
Pretty printing last change.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index bfc653d..cd867b6 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -138,18 +138,18 @@ pthread_rwlock_timedwrlock:
movq %rcx, (%rsp) /* Store relative timeout. */
movq %rdi, 8(%rsp)
-#ifdef __ASSUME_PRIVATE_FUTEX
+# ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
xorl PSHARED(%r12), %esi
-#else
-# if FUTEX_WAIT == 0
- movl PSHARED(%r12), %esi
# else
+# if FUTEX_WAIT == 0
+ movl PSHARED(%r12), %esi
+# else
movl $FUTEX_WAIT, %esi
orl PSHARED(%r12), %esi
-# endif
+# endif
xorl %fs:PRIVATE_FUTEX, %esi
-#endif
+# endif
movq %rsp, %r10
movl %r14d, %edx
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d979611eb9f18ead1b8da3e956b941545f682565
commit d979611eb9f18ead1b8da3e956b941545f682565
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sat Jul 18 21:35:33 2009 -0700
Extend x86-64 pthread_rwlock_timedwrlock to use futex syscall with absolute timeout.
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index d5b812e..719d781 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,9 @@
2009-07-18 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+ (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
+ directly use absolute timeout.
+
* tst-cond11.c (run_test): Add test to check that the timeout is
long enough.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index dde6b58..bfc653d 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -36,16 +36,21 @@ pthread_rwlock_timedwrlock:
cfi_startproc
pushq %r12
cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%r12, 0)
pushq %r13
cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%r13, 0)
+#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
+# define VALREG %edx
+#else
pushq %r14
cfi_adjust_cfa_offset(8)
- cfi_offset(%r12, -16)
- cfi_offset(%r13, -24)
- cfi_offset(%r14, -32)
+ cfi_rel_offset(%r14, 0)
subq $16, %rsp
cfi_adjust_cfa_offset(16)
+# define VALREG %r14d
+#endif
movq %rdi, %r12
movq %rsi, %r13
@@ -74,7 +79,7 @@ pthread_rwlock_timedwrlock:
incl WRITERS_QUEUED(%r12)
je 4f
- movl WRITERS_WAKEUP(%r12), %r14d
+ movl WRITERS_WAKEUP(%r12), VALREG
LOCK
#if MUTEX == 0
@@ -84,8 +89,33 @@ pthread_rwlock_timedwrlock:
#endif
jne 10f
+11:
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+# ifdef PIC
+ cmpl $0, __have_futex_clock_realtime(%rip)
+# else
+ cmpl $0, __have_futex_clock_realtime
+# endif
+ je .Lreltmo
+#endif
+
+ movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %esi
+ xorl PSHARED(%r12), %esi
+ movq %r13, %r10
+ movl $0xffffffff, %r9d
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+ movl %r14d, %edx
+#endif
+21: leaq WRITERS_WAKEUP(%r12), %rdi
+ movl $SYS_futex, %eax
+ syscall
+ movq %rax, %rdx
+
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+ .subsection 2
+.Lreltmo:
/* Get current time. */
-11: movq %rsp, %rdi
+ movq %rsp, %rdi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
callq *%rax
@@ -122,13 +152,12 @@ pthread_rwlock_timedwrlock:
#endif
movq %rsp, %r10
movl %r14d, %edx
- leaq WRITERS_WAKEUP(%r12), %rdi
- movl $SYS_futex, %eax
- syscall
- movq %rax, %rdx
-17:
- /* Reget the lock. */
+ jmp 21b
+ .previous
+#endif
+
+17: /* Reget the lock. */
movl $1, %esi
xorl %eax, %eax
LOCK
@@ -160,11 +189,13 @@ pthread_rwlock_timedwrlock:
7: movq %rdx, %rax
+#ifndef __ASSUME_PRIVATE_FUTEX
addq $16, %rsp
cfi_adjust_cfa_offset(-16)
popq %r14
cfi_adjust_cfa_offset(-8)
cfi_restore(%r14)
+#endif
popq %r13
cfi_adjust_cfa_offset(-8)
cfi_restore(%r13)
@@ -173,10 +204,16 @@ pthread_rwlock_timedwrlock:
cfi_restore(%r12)
retq
+#ifdef __ASSUME_PRIVATE_FUTEX
+ cfi_adjust_cfa_offset(16)
+ cfi_rel_offset(%r12, 8)
+ cfi_rel_offset(%r13, 0)
+#else
cfi_adjust_cfa_offset(40)
cfi_offset(%r12, -16)
cfi_offset(%r13, -24)
cfi_offset(%r14, -32)
+#endif
1: movl PSHARED(%rdi), %esi
#if MUTEX != 0
addq $MUTEX, %rdi
-----------------------------------------------------------------------
Summary of changes:
nptl/ChangeLog | 6 ++
.../sysv/linux/x86_64/pthread_rwlock_timedrdlock.S | 73 +++++++++++++++-----
.../sysv/linux/x86_64/pthread_rwlock_timedwrlock.S | 73 +++++++++++++++-----
3 files changed, 116 insertions(+), 36 deletions(-)
hooks/post-receive
--
GNU C Library master sources