25845f
commit 9ce673b69e82578044958f66d93dcaddb23f6e95
25845f
Author: Florian Weimer <fweimer@redhat.com>
25845f
Date:   Wed Aug 30 16:20:20 2017 +0200
25845f
25845f
    Do not scale NPTL tests with available number of CPUs
25845f
    
25845f
    On very large multi-processor systems, creating hundreds of threads
25845f
    runs into a test time out.  The tests do not seem to benefit from
25845f
    massive over-scheduling.
25845f
25845f
Index: b/nptl/tst-cond16.c
25845f
===================================================================
25845f
--- a/nptl/tst-cond16.c
25845f
+++ b/nptl/tst-cond16.c
25845f
@@ -27,7 +27,7 @@ pthread_cond_t cv = PTHREAD_COND_INITIAL
25845f
 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
25845f
 bool n, exiting;
25845f
 FILE *f;
25845f
-int count;
25845f
+enum { count = 8 };		/* Number of worker threads.  */
25845f
 
25845f
 void *
25845f
 tf (void *dummy)
25845f
@@ -70,11 +70,6 @@ do_test (void)
25845f
       return 1;
25845f
     }
25845f
 
25845f
-  count = sysconf (_SC_NPROCESSORS_ONLN);
25845f
-  if (count <= 0)
25845f
-    count = 1;
25845f
-  count *= 4;
25845f
-
25845f
   pthread_t th[count];
25845f
   pthread_attr_t attr;
25845f
   int i, ret, sz;
25845f
Index: b/nptl/tst-cond18.c
25845f
===================================================================
25845f
--- a/nptl/tst-cond18.c
25845f
+++ b/nptl/tst-cond18.c
25845f
@@ -27,7 +27,8 @@
25845f
 pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
25845f
 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
25845f
 bool exiting;
25845f
-int fd, count, spins, nn;
25845f
+int fd, spins, nn;
25845f
+enum { count = 8 };		/* Number of worker threads.  */
25845f
 
25845f
 void *
25845f
 tf (void *id)
25845f
@@ -81,11 +82,6 @@ do_test (void)
25845f
       return 1;
25845f
     }
25845f
 
25845f
-  count = sysconf (_SC_NPROCESSORS_ONLN);
25845f
-  if (count <= 0)
25845f
-    count = 1;
25845f
-  count *= 8;
25845f
-
25845f
   pthread_t th[count + 1];
25845f
   pthread_attr_t attr;
25845f
   int i, ret, sz;