Blame SOURCES/glibc-rh841653-2.patch

147e83
commit 68cc29355f3334c7ad18f648ff9a6383a0916d23
147e83
Author: Andi Kleen <ak@linux.intel.com>
147e83
Date:   Fri Jun 28 05:19:37 2013 -0700
147e83
147e83
    Add minimal test suite changes for elision enabled kernels
147e83
    
147e83
    tst-mutex5 and 8 test some behaviour not required by POSIX,
147e83
    that elision changes. This changes these tests to not check
147e83
    this when elision is enabled at configure time.
147e83
Index: glibc-2.17-c758a686/nptl/tst-mutex5.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/nptl/tst-mutex5.c
147e83
+++ glibc-2.17-c758a686/nptl/tst-mutex5.c
147e83
@@ -22,6 +22,7 @@
147e83
 #include <time.h>
147e83
 #include <unistd.h>
147e83
 #include <sys/time.h>
147e83
+#include <config.h>
147e83
 
147e83
 
147e83
 #ifndef TYPE
147e83
@@ -85,6 +86,8 @@ do_test (void)
147e83
       return 1;
147e83
     }
147e83
 
147e83
+  /* Elided locks do not time out.  */
147e83
+#ifdef ENABLE_LOCK_ELISION
147e83
   if (pthread_mutex_trylock (&m) == 0)
147e83
     {
147e83
       puts ("mutex_trylock succeeded");
147e83
@@ -180,6 +183,7 @@ do_test (void)
147e83
       puts ("3rd timedlock didn't return right away");
147e83
       return 1;
147e83
     }
147e83
+#endif
147e83
 
147e83
   if (pthread_mutex_unlock (&m) != 0)
147e83
     {
147e83
Index: glibc-2.17-c758a686/nptl/tst-mutex8.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/nptl/tst-mutex8.c
147e83
+++ glibc-2.17-c758a686/nptl/tst-mutex8.c
147e83
@@ -93,6 +93,8 @@ tf (void *arg)
147e83
 static int
147e83
 check_type (const char *mas, pthread_mutexattr_t *ma)
147e83
 {
147e83
+  int e __attribute__((unused));
147e83
+
147e83
   if (pthread_mutex_init (m, ma) != 0)
147e83
     {
147e83
       printf ("1st mutex_init failed for %s\n", mas);
147e83
@@ -117,7 +119,10 @@ check_type (const char *mas, pthread_mut
147e83
       return 1;
147e83
     }
147e83
 
147e83
-  int e = pthread_mutex_destroy (m);
147e83
+  /* Elided mutexes don't fail destroy. If elision is not explicitly disabled
147e83
+     we don't know, so can also not check this.  */
147e83
+#ifndef ENABLE_LOCK_ELISION
147e83
+  e = pthread_mutex_destroy (m);
147e83
   if (e == 0)
147e83
     {
147e83
       printf ("mutex_destroy of self-locked mutex succeeded for %s\n", mas);
147e83
@@ -129,6 +134,7 @@ check_type (const char *mas, pthread_mut
147e83
 	      mas);
147e83
       return 1;
147e83
     }
147e83
+#endif
147e83
 
147e83
   if (pthread_mutex_unlock (m) != 0)
147e83
     {
147e83
@@ -142,6 +148,8 @@ check_type (const char *mas, pthread_mut
147e83
       return 1;
147e83
     }
147e83
 
147e83
+  /* Elided mutexes don't fail destroy.  */
147e83
+#ifndef ENABLE_LOCK_ELISION
147e83
   e = pthread_mutex_destroy (m);
147e83
   if (e == 0)
147e83
     {
147e83
@@ -155,6 +163,7 @@ mutex_destroy of self-trylocked mutex di
147e83
 	      mas);
147e83
       return 1;
147e83
     }
147e83
+#endif
147e83
 
147e83
   if (pthread_mutex_unlock (m) != 0)
147e83
     {
147e83
@@ -189,6 +198,8 @@ mutex_destroy of self-trylocked mutex di
147e83
       return 1;
147e83
     }
147e83
 
147e83
+  /* Elided mutexes don't fail destroy.  */
147e83
+#ifndef ENABLE_LOCK_ELISION
147e83
   e = pthread_mutex_destroy (m);
147e83
   if (e == 0)
147e83
     {
147e83
@@ -201,6 +212,7 @@ mutex_destroy of self-trylocked mutex di
147e83
 mutex_destroy of condvar-used mutex did not return EBUSY for %s\n", mas);
147e83
       return 1;
147e83
     }
147e83
+#endif
147e83
 
147e83
   done = true;
147e83
   if (pthread_cond_signal (&c) != 0)
147e83
@@ -259,6 +271,8 @@ mutex_destroy of condvar-used mutex did
147e83
       return 1;
147e83
     }
147e83
 
147e83
+  /* Elided mutexes don't fail destroy.  */
147e83
+#ifndef ENABLE_LOCK_ELISION
147e83
   e = pthread_mutex_destroy (m);
147e83
   if (e == 0)
147e83
     {
147e83
@@ -273,6 +287,7 @@ mutex_destroy of condvar-used mutex did
147e83
 	      mas);
147e83
       return 1;
147e83
     }
147e83
+#endif
147e83
 
147e83
   if (pthread_cancel (th) != 0)
147e83
     {