This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Do not scale NPTL tests with available number of CPUs
- From: fweimer at redhat dot com (Florian Weimer)
- To: libc-alpha at sourceware dot org
- Date: Wed, 30 Aug 2017 14:44:48 +0200
- Subject: [PATCH] Do not scale NPTL tests with available number of CPUs
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9844A130C
On very large multi-processor systems, creating hundreds of threads
runs into a test time out. The tests do not seem to benefit from
massive over-scheduling.
2017-08-30 Florian Weimer <fweimer@redhat.com>
Do not scale NPTL tests with available number of CPUs.
* nptl/tst-cond16.c (count): Sett to constant value of 8.
* nptl/tst-cond18.c (count): Likewise.
diff --git a/nptl/tst-cond16.c b/nptl/tst-cond16.c
index 032677adcc..b3bfb90bd4 100644
--- a/nptl/tst-cond16.c
+++ b/nptl/tst-cond16.c
@@ -28,7 +28,7 @@ pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
bool n, exiting;
FILE *f;
-int count;
+enum { count = 8 }; /* Number of worker threads. */
void *
tf (void *dummy)
@@ -71,11 +71,6 @@ do_test (void)
return 1;
}
- count = sysconf (_SC_NPROCESSORS_ONLN);
- if (count <= 0)
- count = 1;
- count *= 4;
-
pthread_t th[count];
pthread_attr_t attr;
int i, ret, sz;
diff --git a/nptl/tst-cond18.c b/nptl/tst-cond18.c
index 187f3af1df..6276110ec2 100644
--- a/nptl/tst-cond18.c
+++ b/nptl/tst-cond18.c
@@ -28,7 +28,8 @@
pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
bool exiting;
-int fd, count, spins, nn;
+int fd, spins, nn;
+enum { count = 8 }; /* Number of worker threads. */
void *
tf (void *id)
@@ -82,11 +83,6 @@ do_test (void)
return 1;
}
- count = sysconf (_SC_NPROCESSORS_ONLN);
- if (count <= 0)
- count = 1;
- count *= 8;
-
pthread_t th[count + 1];
pthread_attr_t attr;
int i, ret, sz;