This is the mail archive of the libc-alpha@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]

[PATCH] Speedup nptl/tst-rwlock19.


Hi,

the test creates 15 threads which are trying 5000x to pthread_rwlock_rdlock
a modified lock where the number of readers is set to max - 5.  If locked
successfully, it sleeps for 1ms.

The test succeeds if the lock was rdlock'ed successfully for at least
one time and it has failed at least once with EAGAIN and the
number of readers needs to be max - 5 again after all threads have joined.

The test is currently running for 5 seconds.  Thus this patch reduces
the READTRIES from 5000 to 100 and is increasing the DELAY from 1ms to 5ms.
Then the test runs for roughly 0.5 seconds.

Bye,
Stefan

ChangeLog:

	* nptl/tst-rwlock19.c (READTRIES): Reduce to 100.
	(DELAY) Increase to 5000000.
commit 2792fbbc18473026b2552cc8c2664146233760c4
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Thu Sep 12 09:19:01 2019 +0200

    Speedup nptl/tst-rwlock19.
    
    The test creates 15 threads which are trying 5000x to pthread_rwlock_rdlock
    a modified lock where the number of readers is set to max - 5.  If locked
    successfully, it sleeps for 1ms.
    
    The test succeeds if the lock was rdlock'ed successfully for at least
    one time and it has failed at least once with EAGAIN and the
    number of readers needs to be max - 5 again after all threads have joined.
    
    The test is currently running for 5 seconds.  Thus this patch reduces
    the READTRIES from 5000 to 100 and is increasing the DELAY from 1ms to 5ms.
    Then the test runs for roughly 0.5 seconds.
    
    ChangeLog:
    
            * nptl/tst-rwlock19.c (READTRIES): Reduce to 100.
            (DELAY) Increase to 5000000.

diff --git a/nptl/tst-rwlock19.c b/nptl/tst-rwlock19.c
index 19d40c11ca..3f98ef69f6 100644
--- a/nptl/tst-rwlock19.c
+++ b/nptl/tst-rwlock19.c
@@ -26,9 +26,9 @@
 
 
 #define NREADERS 15
-#define READTRIES 5000
+#define READTRIES 100
 
-#define DELAY   1000000
+#define DELAY   5000000
 
 static pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;
 static int eagain_returned = 0;

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