This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch siddhesh/wait_bitset updated. glibc-2.16-ports-merge-545-gb16dda1


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, siddhesh/wait_bitset has been updated
       via  b16dda1686e938f31ebd19803aba4ad6c6f9165e (commit)
       via  8dd1e61ebbfeaf4af2658508ab938071683506de (commit)
       via  a3184ea91816880b58497f2c56000f5c4794ec33 (commit)
       via  695795b6d297b20e6e4f054bdbdc54084beff4c9 (commit)
       via  ed9b2cbe120b9e3551d250d6c74418a8c39aa4e8 (commit)
       via  37e98ca8a3b88d9f1c582e5e4821f82a39c9a262 (commit)
       via  9ce90d89bd6f7c1f6fbb87e147378b7d163a8fa6 (commit)
       via  b9473651bcf3f0bbea40e9c1e68ec67214faf969 (commit)
       via  f303f97c2934288f6314c59564e6630925731f41 (commit)
       via  e2211bed12912a57e3ff9b2c42b0d85a949354bc (commit)
       via  6a345e4261f34abd45b15c41469a942237a48537 (commit)
       via  1e9d84cdbc46301a0d9e83f7044393f7d8139382 (commit)
       via  c0a1472e2272045d6520eb92f6a5438e2323b79b (commit)
       via  df381762dc462d62b4a2994fa6399f5cfa8891a3 (commit)
       via  af3a9965e5f31f18277ca56585cbc486a616d49c (commit)
       via  bff6491355e54a58906c2fdd9ffc7e1549308f35 (commit)
       via  25fe89324c4d23ea467ea6902da6feb344dae3f4 (commit)
       via  cc1290d07e9bb5662642846c50c97c853d1827b5 (commit)
       via  6e6249d0b461b952d0f544792372663feb6d792a (commit)
       via  0cae3f4b033e441d820f4521fa5736e4e6e4d713 (commit)
       via  de2b6422c641490b92b3130a519693166323423c (commit)
       via  0bf57f872cb14db88ca8860e9f5b295e38394f16 (commit)
       via  8175a2532bd19cca1592f9c7f598302c5ae3770a (commit)
       via  10b40d85672e13032422572f2106752b31ed1704 (commit)
       via  0708a7d1f08d12da03bbaac84e59370f75030d95 (commit)
       via  3a8db22f07e2ab5373d4a366672a7a7b158ada96 (commit)
       via  9fddec1a48b8ddf69c7599be9b3a47bf9e5c066c (commit)
       via  03ac099f6bc9157cdec50db10944e1d99ff07aa1 (commit)
       via  ebfd1bbd04fcc82c34d6f46d942ab763a60ede03 (commit)
       via  166bca248032399a5a13258b13b8fdb9c1da1ed1 (commit)
       via  88866099db3973a1b4d3bb0fb3f45efea067e4e8 (commit)
       via  b4b4c2968ece5f95bffa6893b5d5b50e966ed40f (commit)
       via  6fb54a225415a91050eb004d05bc62d6c3ca2b53 (commit)
       via  2b4a59f535079f07d7d63c3bab98e67263092c71 (commit)
       via  2a0e2669f902dc574e70f5473f7c165d55b49311 (commit)
      from  528e6e7ab4389ffad0c506714c485498821554c1 (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=b16dda1686e938f31ebd19803aba4ad6c6f9165e

commit b16dda1686e938f31ebd19803aba4ad6c6f9165e
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Oct 26 15:46:13 2012 +0530

    Removed old ChangeLog

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 07c1b52..8b8e0cd 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -80,17 +80,6 @@
 	(tst-exec4-ARGS): Likewise.
 	(tst-stackguard1-ARGS): Likewise.
 
-2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
-
-	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
-	if absolute timeout is negative.
-	[__ASSUME_FUTEX_CLOCK_REALTIME &&
-	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
-	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
-	(lll_futex_timed_wait_bitset): New macro.
-	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
-	(lll_futex_timed_wait_bitset): Likewise.
-
 2012-10-21  Jim Blandy  <jimb@codesourcery.com>
 	    Joseph Myers  <joseph@codesourcery.com>
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8dd1e61ebbfeaf4af2658508ab938071683506de

commit 8dd1e61ebbfeaf4af2658508ab938071683506de
Merge: a3184ea 528e6e7
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Oct 26 15:44:35 2012 +0530

    Merge branch 'siddhesh/wait_bitset' of ssh://sourceware.org/git/glibc into siddhesh/wait_bitset
    
    Conflicts:
    	nptl/pthread_cond_timedwait.c

diff --cc nptl/ChangeLog
index 8b8e0cd,70c0919..07c1b52
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@@ -1,85 -1,14 +1,96 @@@
 +2012-10-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
 +
 +	* pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
 +	Time out if absolute timeout is negative.
 +	[__ASSUME_FUTEX_CLOCK_REALTIME &&
 +	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
 +	* pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
 +	Likewise.
 +	* sysdeps/unix/sysv/linux/lowlevelrobustlock.c
 +	(__lll_robust_timedlock_wait): Likewise.
 +
 +2012-10-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
 +
 +	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
 +	if absolute timeout is negative.
 +	[__ASSUME_FUTEX_CLOCK_REALTIME &&
 +	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
 +	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
 +	(lll_futex_timed_wait_bitset): New macro.
 +	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
 +	(lll_futex_timed_wait_bitset): Likewise.
 +
 +2012-10-25  Roland McGrath  <roland@hack.frob.com>
 +
 +	* tst-cond-except.c (TEST_FUNCTION): New macro.
 +
 +2012-10-25  Joseph Myers  <joseph@codesourcery.com>
 +
 +	* Makefile ($(objpfx)tst-tls6.out): Use $(BASH) not $(SHELL) to
 +	run tst-tls6.sh.
 +	* tst-tls6.sh: Use /bin/bash not /bin/sh.
 +
 +2012-10-25  Roland McGrath  <roland@hack.frob.com>
 +
 +	* tst-basic2.c (do_test): Return RESULT, not always zero.
 +
 +	* tst-cond25.c: Include <stdint.h>
 +	(waiter): Add casts to uintptr_t between casting integer<->pointer.
 +	(timed_waiter): Likewise.
 +	(do_test_wait): Likewise.
 +	* tst-cond-except.c (thr): Likewise.
 +	(do_test): Use prototype definition.
 +
 +2012-10-24  Joseph Myers  <joseph@codesourcery.com>
 +	    Jim Blandy  <jimb@codesourcery.com>
 +
 +	* Makefile ($(objpfx)tst-tls6.out): Pass $(test-wrapper-env) to
 +	tst-tls6.sh.
 +	* tst-tls6.sh (test_wrapper_env): New variable.  Use it to run
 +	programs with LD_PRELOAD set.
 +
 +2012-10-24  Roland McGrath  <roland@hack.frob.com>
 +
 +	* Makefile ($(objpfx)tst-cond11, $(objpfx)tst-cond19): Targets removed.
 +	($(objpfx)tst-sem5, $(objpfx)tst-cancel18): Likewise.
 +	((objpfx)tst-cancelx18, $(objpfx)tst-clock2): Likewise.
 +	($(objpfx)tst-rwlock14): Likewise.
 +
 +2012-10-24  Joseph Myers  <joseph@codesourcery.com>
 +
 +	* Makefile (tests): Remove tst-oddstacklimit.
 +	(test-srcs): New variable.
 +	(tst-oddstacklimit-ENV): Remove.
 +	[$(run-built-tests) = yes] (tests): Depend on
 +	$(objpfx)tst-oddstacklimit.out.
 +	[$(run-built-tests) = yes] ($(objpfx)tst-oddstacklimit.out): New
 +	target.
 +	* tst-oddstacklimit.c: Do not include "tst-basic1.c".  Use
 +	setrlimit before executing tst-basic1 test passed to --command.
 +
 +2012-10-23  Joseph Myers  <joseph@codesourcery.com>
 +
 +	* Makefile [$(cross-compiling) = no]: Change condition to
 +	[$(run-built-tests) = yes].
 +
 +2012-10-23  Jim Blandy  <jimb@codesourcery.com>
 +	    Joseph Myers  <joseph@codesourcery.com>
 +
 +	* Makefile (tst-cancel7-ARGS): Use $(host-built-program-cmd).
 +	(tst-exec4-ARGS): Likewise.
 +	(tst-stackguard1-ARGS): Likewise.
 +
+ 2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
+ 
+ 	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
+ 	if absolute timeout is negative.
+ 	[__ASSUME_FUTEX_CLOCK_REALTIME &&
+ 	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
+ 	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+ 	(lll_futex_timed_wait_bitset): New macro.
+ 	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
+ 	(lll_futex_timed_wait_bitset): Likewise.
+ 
  2012-10-21  Jim Blandy  <jimb@codesourcery.com>
  	    Joseph Myers  <joseph@codesourcery.com>
  

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a3184ea91816880b58497f2c56000f5c4794ec33

commit a3184ea91816880b58497f2c56000f5c4794ec33
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Oct 26 15:17:21 2012 +0530

    Use FUTEX_WAIT_BITSET for pthread_rwlock and robust_timedlock

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 780dc97..8b8e0cd 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,6 +1,15 @@
-2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
+2012-10-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
-2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
+	* pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
+	Time out if absolute timeout is negative.
+	[__ASSUME_FUTEX_CLOCK_REALTIME &&
+	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
+	* pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
+	Likewise.
+	* sysdeps/unix/sysv/linux/lowlevelrobustlock.c
+	(__lll_robust_timedlock_wait): Likewise.
+
+2012-10-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
 	if absolute timeout is negative.
diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/pthread_rwlock_timedrdlock.c
index be8216d..b7622ab 100644
--- a/nptl/pthread_rwlock_timedrdlock.c
+++ b/nptl/pthread_rwlock_timedrdlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
 
@@ -76,6 +76,16 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
 	  break;
 	}
 
+      /* Work around the fact that the kernel rejects negative timeout values
+	 despite them being valid.  */
+      if (__builtin_expect (abstime->tv_sec < 0, 0))
+	{
+	  result = ETIMEDOUT;
+	  break;
+	}
+
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       /* Get the current time.  So far we support only one clock.  */
       struct timeval tv;
       (void) gettimeofday (&tv, NULL);
@@ -96,6 +106,7 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
 	  result = ETIMEDOUT;
 	  break;
 	}
+#endif
 
       /* Remember that we are a reader.  */
       if (++rwlock->__data.__nr_readers_queued == 0)
@@ -112,8 +123,16 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
       lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared);
 
       /* Wait for the writer to finish.  */
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       err = lll_futex_timed_wait (&rwlock->__data.__readers_wakeup,
 				  waitval, &rt, rwlock->__data.__shared);
+#else
+      err = lll_futex_timed_wait_bitset (&rwlock->__data.__readers_wakeup,
+					 waitval, abstime,
+					 FUTEX_CLOCK_REALTIME,
+					 rwlock->__data.__shared);
+#endif
 
       /* Get the lock.  */
       lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/pthread_rwlock_timedwrlock.c
index 8eb31cf..5f2399f 100644
--- a/nptl/pthread_rwlock_timedwrlock.c
+++ b/nptl/pthread_rwlock_timedwrlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
 
@@ -67,6 +67,16 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 	  break;
 	}
 
+      /* Work around the fact that the kernel rejects negative timeout values
+	 despite them being valid.  */
+      if (__builtin_expect (abstime->tv_sec < 0, 0))
+	{
+	  result = ETIMEDOUT;
+	  break;
+	}
+
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       /* Get the current time.  So far we support only one clock.  */
       struct timeval tv;
       (void) gettimeofday (&tv, NULL);
@@ -86,6 +96,7 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 	  result = ETIMEDOUT;
 	  break;
 	}
+#endif
 
       /* Remember that we are a writer.  */
       if (++rwlock->__data.__nr_writers_queued == 0)
@@ -102,8 +113,16 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
       lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared);
 
       /* Wait for the writer or reader(s) to finish.  */
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       err = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup,
 				  waitval, &rt, rwlock->__data.__shared);
+#else
+      err = lll_futex_timed_wait_bitset (&rwlock->__data.__writer_wakeup,
+					 waitval, abstime,
+					 FUTEX_CLOCK_REALTIME,
+					 rwlock->__data.__shared);
+#endif
 
       /* Get the lock.  */
       lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c b/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
index 7b4e843..9a9e673 100644
--- a/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
+++ b/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
 
@@ -70,8 +70,15 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
   if (oldval == 0)
     goto try;
 
+  /* Work around the fact that the kernel rejects negative timeout values
+     despite them being valid.  */
+  if (__builtin_expect (abstime->tv_sec < 0, 0))
+    return ETIMEDOUT;
+
   do
     {
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       struct timeval tv;
       struct timespec rt;
 
@@ -90,6 +97,7 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
       /* Already timed out?  */
       if (rt.tv_sec < 0)
 	return ETIMEDOUT;
+#endif
 
       /* Wait.  */
       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
@@ -100,7 +108,13 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
 	  && atomic_compare_and_exchange_bool_acq (futex, newval, oldval))
 	continue;
 
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       lll_futex_timed_wait (futex, newval, &rt, private);
+#else
+      lll_futex_timed_wait_bitset (futex, newval, abstime,
+				   FUTEX_CLOCK_REALTIME, private);
+#endif
 
     try:
       ;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=695795b6d297b20e6e4f054bdbdc54084beff4c9

commit 695795b6d297b20e6e4f054bdbdc54084beff4c9
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Oct 26 14:21:45 2012 +0530

    Fix gaffe in clockbit condition

diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
index b5661e6..2fcbc57 100644
--- a/nptl/pthread_cond_timedwait.c
+++ b/nptl/pthread_cond_timedwait.c
@@ -163,7 +163,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 				  futex_val, &rt, pshared);
 #else
       unsigned int clockbit = (cond->__data.__nwaiters & 1
-			       ? FUTEX_CLOCK_REALTIME : 0);
+			       ? 0 : FUTEX_CLOCK_REALTIME);
       err = lll_futex_timed_wait_bitset (&cond->__data.__futex, futex_val,
 					 abstime, clockbit, pshared);
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ed9b2cbe120b9e3551d250d6c74418a8c39aa4e8

commit ed9b2cbe120b9e3551d250d6c74418a8c39aa4e8
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Oct 24 13:01:52 2012 +0530

    Fixed minor nits based on Roland's comments
    
    http://sourceware.org/ml/libc-alpha/2012-10/msg00648.html

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index baa9fe4..780dc97 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,13 +1,15 @@
 2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
-	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Timeout
+2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
 	if absolute timeout is negative.
 	[__ASSUME_FUTEX_CLOCK_REALTIME &&
 	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
 	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
-	(lll_futex_timed_wait_bitset); Define.
+	(lll_futex_timed_wait_bitset): New macro.
 	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
-	(lll_futex_timed_wait_bitset); Likewise.
+	(lll_futex_timed_wait_bitset): Likewise.
 
 2012-10-25  Roland McGrath  <roland@hack.frob.com>
 
diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
index 800aa86..b5661e6 100644
--- a/nptl/pthread_cond_timedwait.c
+++ b/nptl/pthread_cond_timedwait.c
@@ -109,8 +109,8 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 
   while (1)
     {
-#if (!defined(__ASSUME_FUTEX_CLOCK_REALTIME) \
-     || !defined(lll_futex_timed_wait_bitset))
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       struct timespec rt;
       {
 # ifdef __NR_clock_gettime
@@ -156,8 +156,8 @@ __pthread_cond_timedwait (cond, mutex, abstime)
       /* Enable asynchronous cancellation.  Required by the standard.  */
       cbuffer.oldtype = __pthread_enable_asynccancel ();
 
-#if (!defined(__ASSUME_FUTEX_CLOCK_REALTIME) \
-     || !defined(lll_futex_timed_wait_bitset))
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
+     || !defined lll_futex_timed_wait_bitset)
       /* Wait until woken by signal or broadcast.  */
       err = lll_futex_timed_wait (&cond->__data.__futex,
 				  futex_val, &rt, pshared);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37e98ca8a3b88d9f1c582e5e4821f82a39c9a262

commit 37e98ca8a3b88d9f1c582e5e4821f82a39c9a262
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Oct 22 18:25:55 2012 +0530

    changelog for the fix

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 40ddc25..baa9fe4 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,14 @@
+2012-10-22  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* pthread_cond_timedwait.c (__pthread_cond_timedwait): Timeout
+	if absolute timeout is negative.
+	[__ASSUME_FUTEX_CLOCK_REALTIME &&
+	lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
+	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+	(lll_futex_timed_wait_bitset); Define.
+	* sysdeps/unix/sysv/linux/s390/lowlevellock.h
+	(lll_futex_timed_wait_bitset); Likewise.
+
 2012-10-25  Roland McGrath  <roland@hack.frob.com>
 
 	* tst-cond-except.c (TEST_FUNCTION): New macro.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9ce90d89bd6f7c1f6fbb87e147378b7d163a8fa6

commit 9ce90d89bd6f7c1f6fbb87e147378b7d163a8fa6
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Oct 22 15:11:04 2012 +0530

    Implement futex_wait_bitset for non-x86 timedwait
    
    Done: powerpc, s390

diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
index 51a34ba..800aa86 100644
--- a/nptl/pthread_cond_timedwait.c
+++ b/nptl/pthread_cond_timedwait.c
@@ -80,6 +80,11 @@ __pthread_cond_timedwait (cond, mutex, abstime)
   ++cond->__data.__futex;
   cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT;
 
+  /* Work around the fact that the kernel rejects negative timeout values
+     despite them being valid.  */
+  if (__builtin_expect (abstime->tv_sec < 0, 0))
+    goto timeout;
+
   /* Remember the mutex we are using here.  If there is already a
      different address store this is a bad user bug.  Do not store
      anything for pshared condvars.  */
@@ -104,9 +109,11 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 
   while (1)
     {
+#if (!defined(__ASSUME_FUTEX_CLOCK_REALTIME) \
+     || !defined(lll_futex_timed_wait_bitset))
       struct timespec rt;
       {
-#ifdef __NR_clock_gettime
+# ifdef __NR_clock_gettime
 	INTERNAL_SYSCALL_DECL (err);
 	int ret;
 	ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
@@ -116,7 +123,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 	/* Convert the absolute timeout value to a relative timeout.  */
 	rt.tv_sec = abstime->tv_sec - rt.tv_sec;
 	rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
-#else
+# else
 	/* Get the current time.  So far we support only one clock.  */
 	struct timeval tv;
 	(void) gettimeofday (&tv, NULL);
@@ -124,7 +131,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 	/* Convert the absolute timeout value to a relative timeout.  */
 	rt.tv_sec = abstime->tv_sec - tv.tv_sec;
 	rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
-#endif
+# endif
       }
       if (rt.tv_nsec < 0)
 	{
@@ -139,6 +146,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 
 	  goto timeout;
 	}
+#endif
 
       unsigned int futex_val = cond->__data.__futex;
 
@@ -148,9 +156,17 @@ __pthread_cond_timedwait (cond, mutex, abstime)
       /* Enable asynchronous cancellation.  Required by the standard.  */
       cbuffer.oldtype = __pthread_enable_asynccancel ();
 
+#if (!defined(__ASSUME_FUTEX_CLOCK_REALTIME) \
+     || !defined(lll_futex_timed_wait_bitset))
       /* Wait until woken by signal or broadcast.  */
       err = lll_futex_timed_wait (&cond->__data.__futex,
 				  futex_val, &rt, pshared);
+#else
+      unsigned int clockbit = (cond->__data.__nwaiters & 1
+			       ? FUTEX_CLOCK_REALTIME : 0);
+      err = lll_futex_timed_wait_bitset (&cond->__data.__futex, futex_val,
+					 abstime, clockbit, pshared);
+#endif
 
       /* Disable asynchronous cancellation.  */
       __pthread_disable_asynccancel (cbuffer.oldtype);
diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index 406c290..17e63c6 100644
--- a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -88,6 +88,19 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;		      \
   })
 
+#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret;							      \
+    int __op = FUTEX_WAIT_BITSET | clockbit;				      \
+									      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (__op, private),	      \
+			      (val), (timespec), NULL /* Unused.  */, 	      \
+			      FUTEX_BITSET_MATCH_ANY);			      \
+    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;		      \
+  })
+
 #define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index 9709282..0b7110f 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -93,6 +93,26 @@
     __result;								      \
   })
 
+#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
+  ({									      \
+    register unsigned long int __r2 asm ("2") = (unsigned long int) (futexp); \
+    register unsigned long int __r3 asm ("3")				      \
+      = __lll_private_flag ((FUTEX_WAIT_BITSET | clockbit), private);	      \
+    register unsigned long int __r4 asm ("4") = (long int) (val);	      \
+    register unsigned long int __r5 asm ("5") = (long int) (timespec);	      \
+    register unsigned long int __r6 asm ("6") = (unsigned long int) (NULL);   \
+    register unsigned long int __r7 asm ("7")				      \
+      = (unsigned int) (FUTEX_BITSET_MATCH_ANY);			      \
+    register unsigned long __result asm ("2");				      \
+									      \
+    __asm __volatile ("svc %b1"						      \
+		      : "=d" (__result)					      \
+		      : "i" (SYS_futex), "0" (__r2), "d" (__r3),	      \
+			"d" (__r4), "d" (__r5), "d" (__r6), "d" (__r7)	      \
+		      : "cc", "memory" );				      \
+    __result;								      \
+  })
+
 
 #define lll_futex_wake(futex, nr, private) \
   ({									      \

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  261 +++++++++++++++++-
 INSTALL                                            |    8 +-
 Makeconfig                                         |   60 ++++-
 NEWS                                               |   12 +-
 Rules                                              |    7 +-
 catgets/Makefile                                   |    2 +-
 config.h.in                                        |    3 +
 configure                                          |  234 +++++++++--------
 configure.in                                       |   43 ++-
 elf/Makefile                                       |   17 +-
 elf/tst-pathopt.sh                                 |    3 +-
 elf/tst-rtld-load-self.sh                          |   11 +-
 grp/Makefile                                       |    2 +-
 iconv/Makefile                                     |    2 +-
 iconvdata/Makefile                                 |    4 +-
 iconvdata/run-iconv-test.sh                        |   14 +-
 iconvdata/tst-tables.sh                            |    2 +-
 include/time.h                                     |    6 +-
 intl/Makefile                                      |    2 +-
 io/Makefile                                        |    2 +-
 io/fcntl.h                                         |   52 ++--
 io/ftwtest-sh                                      |    2 +-
 libio/Makefile                                     |    2 +-
 localedata/ChangeLog                               |   19 ++
 localedata/Makefile                                |    4 +-
 localedata/tst-fmon.sh                             |    2 +-
 localedata/tst-numeric.sh                          |    2 +-
 localedata/tst-rpmatch.sh                          |    2 +-
 malloc/Makefile                                    |    2 +-
 manual/install.texi                                |    9 +-
 misc/Makefile                                      |    2 +-
 nptl/ChangeLog                                     |   73 +++++-
 nptl/Makefile                                      |   56 ++---
 nptl/pthread_cond_timedwait.c                      |    2 +-
 nptl/pthread_rwlock_timedrdlock.c                  |   21 ++-
 nptl/pthread_rwlock_timedwrlock.c                  |   21 ++-
 nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c  |   16 +-
 nptl/tst-basic2.c                                  |    4 +-
 nptl/tst-cond-except.c                             |    6 +-
 nptl/tst-cond25.c                                  |   25 +-
 nptl/tst-oddstacklimit.c                           |   73 +++++-
 nptl/tst-tls6.sh                                   |   28 ++-
 nscd/Makefile                                      |    6 +-
 ports/ChangeLog.alpha                              |    5 +
 ports/ChangeLog.arm                                |   10 +-
 ports/ChangeLog.hppa                               |    5 +
 ports/ChangeLog.ia64                               |   14 +
 ports/ChangeLog.linux-generic                      |    6 +
 ports/ChangeLog.m68k                               |   12 +
 ports/ChangeLog.mips                               |   12 +
 ports/ChangeLog.powerpc                            |    7 +-
 ports/ChangeLog.tile                               |    9 +
 ports/sysdeps/hppa/nptl/Makefile                   |    8 +-
 ports/sysdeps/hppa/nptl/tst-oddstacklimit.c        |   26 ++
 .../unix/sysv/linux/alpha/nptl/libc.abilist        |    5 +
 ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h     |    5 +-
 .../sysdeps/unix/sysv/linux/arm/nptl/libc.abilist  |    5 +
 ports/sysdeps/unix/sysv/linux/generic/bits/fcntl.h |  291 +-------------------
 ports/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h    |  274 +------------------
 ports/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c |    8 +-
 .../sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist |    5 +
 ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h    |  280 +------------------
 .../sysv/linux/m68k/coldfire/nptl/libc.abilist     |    5 +
 .../unix/sysv/linux/m68k/m680x0/nptl/libc.abilist  |    5 +
 ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h    |  270 ++-----------------
 .../unix/sysv/linux/mips/mips32/nptl/libc.abilist  |    5 +
 .../sysv/linux/mips/mips64/n64/nptl/libc.abilist   |    5 +
 .../powerpc/powerpc32/nofpu/nptl/libc.abilist      |    5 +
 .../linux/tile/tilegx/tilegx32/nptl/libc.abilist   |    5 +
 .../linux/tile/tilegx/tilegx64/nptl/libc.abilist   |    5 +
 .../unix/sysv/linux/tile/tilepro/nptl/libc.abilist |    5 +
 posix/Makefile                                     |   20 +-
 posix/globtest.sh                                  |  113 ++++----
 posix/tst-getconf.sh                               |    4 +-
 resolv/Makefile                                    |    4 +-
 rt/Makefile                                        |    9 +-
 rt/Versions                                        |   14 +-
 rt/clock-compat.c                                  |   65 +++++
 rt/clock_getcpuclockid.c                           |    4 +-
 rt/clock_getres.c                                  |    4 +-
 rt/clock_gettime.c                                 |    5 +-
 rt/clock_nanosleep.c                               |    1 +
 rt/clock_settime.c                                 |    4 +-
 scripts/cross-test-ssh.sh                          |  148 ++++++++++
 stdio-common/Makefile                              |    2 +-
 stdlib/Makefile                                    |    2 +-
 string/Makefile                                    |    2 +-
 sysdeps/mach/hurd/ptrace.c                         |    8 +-
 sysdeps/posix/clock_getres.c                       |    3 +-
 .../sparc32/sparcv9/multiarch/ifunc-impl-list.c    |    1 +
 sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c  |   75 +++++
 sysdeps/sparc/sparc64/multiarch/memcpy.S           |    1 +
 sysdeps/sparc/sparc64/multiarch/memset.S           |    1 +
 sysdeps/unix/clock_gettime.c                       |    4 +-
 sysdeps/unix/clock_nanosleep.c                     |    3 +-
 sysdeps/unix/clock_settime.c                       |    3 +-
 sysdeps/unix/sysv/linux/bits/fcntl-linux.h         |    6 +-
 sysdeps/unix/sysv/linux/clock_getcpuclockid.c      |    1 +
 sysdeps/unix/sysv/linux/clock_nanosleep.c          |    1 +
 sysdeps/unix/sysv/linux/i386/get_clockfreq.c       |    8 +-
 sysdeps/unix/sysv/linux/i386/nptl/libc.abilist     |    5 +
 sysdeps/unix/sysv/linux/powerpc/Makefile           |    2 +-
 .../linux/powerpc/powerpc32/fpu/nptl/libc.abilist  |    5 +
 .../sysv/linux/powerpc/powerpc64/nptl/libc.abilist |    5 +
 sysdeps/unix/sysv/linux/s390/bits/fcntl.h          |   32 +--
 .../unix/sysv/linux/s390/s390-32/nptl/libc.abilist |    5 +
 .../unix/sysv/linux/s390/s390-64/nptl/libc.abilist |    5 +
 sysdeps/unix/sysv/linux/sh/nptl/libc.abilist       |    5 +
 sysdeps/unix/sysv/linux/sparc/bits/fcntl.h         |   19 +-
 .../sysv/linux/sparc/sparc32/nptl/libc.abilist     |    5 +
 .../unix/sysv/linux/sparc/sparc64/get_clockfreq.c  |   32 +--
 .../sysv/linux/sparc/sparc64/nptl/libc.abilist     |    5 +
 sysdeps/unix/sysv/linux/x86/bits/fcntl.h           |   16 -
 .../unix/sysv/linux/x86_64/64/nptl/libc.abilist    |    5 +
 .../unix/sysv/linux/x86_64/x32/nptl/libc.abilist   |    5 +
 115 files changed, 1540 insertions(+), 1548 deletions(-)
 create mode 100644 ports/sysdeps/hppa/nptl/tst-oddstacklimit.c
 create mode 100644 rt/clock-compat.c
 create mode 100755 scripts/cross-test-ssh.sh
 create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/ifunc-impl-list.c
 create mode 100644 sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]