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: 1161550 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-105167-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="Dj3034uI"; 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 46Td6Q4xjNz9sCJ for ; Thu, 12 Sep 2019 22:16:30 +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=FLpT+GlkxQF9JOFopn7nk0I7cCqRAPM OxfXsusj2zQmLdimEDq61+Zy3JT9rZVJS2ml1n2cJFV1ViQtmi+Vif1tHHfZZDyD eRD+Se/TY5dSaeqWf+h/qGLDSZ8119mof+VlO8D7CZbI+HFlEsoIZiWmp6vpo+fN NIJTbdLUTKSI= 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=7exUogce/gHo9pTfJ2kroI1JKb4=; b=Dj303 4uImdmqTS0Dp+QR63zwQ1mDon9L9PI594mTheNt5MczsL6SHiCrXdvybrCUS34Sv 7BcHzsflkg/GtDdVTCkByjfFoosdHrlKkipgJTqB8xKkp/E5AEilvU262mwhtv+M nBVbvc5zN1cPuNdtT17v0EJmHK520A2/rggpsU= 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);