unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9.
@ 2019-09-12 12:15 Stefan Liebler
  2019-09-12 14:08 ` Carlos O'Donell
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Liebler @ 2019-09-12 12:15 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

Hi,

each test runs for 6s. do_test_clock is called three times where it
sleeps for two seconds and is then checking if the child process
was killed by SIGALRM.  The child process tries to lock a mutex
which times out after 0.5s and is setting up alarm(1) before it blocks
due to pthread_mutex_lock.

This patch removes the sleep(2) and reduces the timeout for the first
pthread_mutex_[timed|clock]lock call.
As the nptl tests run in sequence, this patch saves roughly 6s of
runtime for "make check".

Bye,
Stefan

ChangeLog:

	* nptl/tst-mutex9.c (do_test_clock): Remove sleep and
	reduce timeout.

[-- Attachment #2: 20190911_nptl_tstmutex9.patch --]
[-- Type: text/x-patch, Size: 1649 bytes --]

commit b31fb5820fb30c933b5ef60a1bd3cc8cff8cf17d
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Wed Sep 11 13:49:37 2019 +0200

    Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9.
    
    Each test runs for 6s. do_test_clock is called three times where it
    sleeps for two seconds and is then checking if the child process
    was killed by SIGALRM.  The child process tries to lock a mutex
    which times out after 0.5s and is setting up alarm(1) before it blocks
    due to pthread_mutex_lock.
    
    This patch removes the sleep(2) and reduces the timeout for the first
    pthread_mutex_[timed|clock]lock call.
    As the nptl tests run in sequence, this patch saves roughly 6s of
    runtime for "make check".
    
    ChangeLog:
    
            * nptl/tst-mutex9.c (do_test_clock): Remove sleep and
            reduce timeout.

diff --git a/nptl/tst-mutex9.c b/nptl/tst-mutex9.c
index d7adcd5061..f776d21533 100644
--- a/nptl/tst-mutex9.c
+++ b/nptl/tst-mutex9.c
@@ -102,7 +102,7 @@ do_test_clock (clockid_t clockid)
         FAIL_EXIT1 ("child: mutex_unlock succeeded");
 
       const struct timespec ts = timespec_add (xclock_now (clockid_for_get),
-                                               make_timespec (0, 500000000));
+                                               make_timespec (0, 100000000));
 
       if (clockid == CLOCK_USE_TIMEDLOCK)
         TEST_COMPARE (pthread_mutex_timedlock (m, &ts), ETIMEDOUT);
@@ -118,8 +118,6 @@ do_test_clock (clockid_t clockid)
       exit (0);
     }
 
-  sleep (2);
-
   int status;
   if (TEMP_FAILURE_RETRY (waitpid (pid, &status, 0)) != pid)
     FAIL_EXIT1 ("waitpid failed");

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9.
  2019-09-12 12:15 [PATCH] Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9 Stefan Liebler
@ 2019-09-12 14:08 ` Carlos O'Donell
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos O'Donell @ 2019-09-12 14:08 UTC (permalink / raw)
  To: Stefan Liebler, GNU C Library

On 9/12/19 8:15 AM, Stefan Liebler wrote:
> Hi,
> 
> each test runs for 6s. do_test_clock is called three times where it
> sleeps for two seconds and is then checking if the child process
> was killed by SIGALRM.  The child process tries to lock a mutex
> which times out after 0.5s and is setting up alarm(1) before it blocks
> due to pthread_mutex_lock.
> 
> This patch removes the sleep(2) and reduces the timeout for the first
> pthread_mutex_[timed|clock]lock call.
> As the nptl tests run in sequence, this patch saves roughly 6s of
> runtime for "make check".
> 
> Bye,
> Stefan
> 
> ChangeLog:
> 
>     * nptl/tst-mutex9.c (do_test_clock): Remove sleep and
>     reduce timeout.

Same comment as I made with "[PATCH] Speedup various nptl/tst-cancel20 and nptl/tst-cancel21 tests."

-- 
Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-12 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 12:15 [PATCH] Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9 Stefan Liebler
2019-09-12 14:08 ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).