From patchwork Thu Sep 12 12:16:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 34516 Received: (qmail 117547 invoked by alias); 12 Sep 2019 12:16:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117474 invoked by uid 89); 12 Sep 2019 12:16:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=0.3 X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Speedup various nptl/tst-mutex5 tests. Date: Thu, 12 Sep 2019 14:16:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 x-cbid: 19091212-4275-0000-0000-00000364DC0B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091212-4276-0000-0000-0000387736A9 Message-Id: <595be47d-f3b5-b4fb-06fb-334f002403b9@linux.ibm.com> Hi, each of these tests - tst-mutex5, tst-mutex5a, tst-mutexpi5 and tst-mutexpi5a - runs for 6s. do_test_clock is called three times, which tries to lock the mutex which times out after 2 seconds. This patch reduces the timeout to 0.3 seconds which leads to a runtime of roughly 0.9s for one tst-mutex5... invocation. As the nptl tests run in sequence, this patch saves roughly 20s of runtime for "make check". Bye, Stefan ChangeLog: * nptl/tst-mutex5.c (do_test_clock): Reduce timeout. commit 50f17c94072cb2a28290ec2d0502dcd9d925b61c Author: Stefan Liebler Date: Wed Sep 11 10:53:48 2019 +0200 Speedup various nptl/tst-mutex5 tests. Each of these tests - tst-mutex5, tst-mutex5a, tst-mutexpi5 and tst-mutexpi5a - runs for 6s. do_test_clock is called three times, which tries to lock the mutex which times out after 2 seconds. This patch reduces the timeout to 0.3 seconds which leads to a runtime of roughly 0.9s for one tst-mutex5... invocation. As the nptl tests run in sequence, this patch saves roughly 20s of runtime for "make check". ChangeLog: * nptl/tst-mutex5.c (do_test_clock): Reduce timeout. diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c index 1ecb483d4d..2f26637301 100644 --- a/nptl/tst-mutex5.c +++ b/nptl/tst-mutex5.c @@ -66,9 +66,9 @@ do_test_clock (clockid_t clockid, const char *fnname) if (pthread_mutex_trylock (&m) == 0) FAIL_EXIT1 ("mutex_trylock succeeded"); - /* Wait 2 seconds. */ + /* Wait 0.3 seconds. */ struct timespec ts_timeout = timespec_add (xclock_now (clockid_for_get), - make_timespec (2, 0)); + make_timespec (0, 300000000)); if (clockid == CLOCK_USE_TIMEDLOCK) TEST_COMPARE (pthread_mutex_timedlock (&m, &ts_timeout), ETIMEDOUT);