From patchwork Thu Sep 12 12:15:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1161548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105165-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="LN200asw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Td646htVz9s4Y for ; Thu, 12 Sep 2019 22:16:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; q=dns; s=default; b=bs4080ZpLtzH7v5yw0zqcVKmwTfwzyG aWHzKNcrMEZwZSauWMXruL71x1BqqhiESh9Hog4tuYxfi0ljy1UW24mb0+GDS0Z6 jFYvDtQpYl4U7+OExQPOKUABZxqSCsBNrBvv+HeTDxGuFTOh19d28B6qqoR1VkBe NeKo7Of7C8+M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; s=default; bh=r5ifYgLggWusjmaBl2g5wAlc/CU=; b=LN200 aswSFZ1C+AxxKgCp7TnuX2iN1IC+yMenI5AGME77DC6/ADd/YzSpCucyp5jiGoKq uisY6Eeyhak3vmWhO7XF/V8NmWJY/f2uW5vRLqutAg8gEUnyJ4PRn8Ik3tqq56rS JDjfHf/DwMnlcKLUXYmoFJZWDaB42CvXADOJLY= Received: (qmail 116244 invoked by alias); 12 Sep 2019 12:16:07 -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 116235 invoked by uid 89); 12 Sep 2019 12:16:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 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= X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Speedup nptl/tst-mutex9 and nptl/tst-mutexpi9. Date: Thu, 12 Sep 2019 14:15:58 +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-0028-0000-0000-0000039B6477 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091212-0029-0000-0000-0000245DCFB3 Message-Id: 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. commit b31fb5820fb30c933b5ef60a1bd3cc8cff8cf17d Author: Stefan Liebler 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");