From patchwork Thu Sep 12 12:15:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1161547 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-105164-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="UYlRrax6"; 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 46Td5v0n5Bz9s4Y for ; Thu, 12 Sep 2019 22:16:02 +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=EPQQznuZ/9Dea1KQpTw0SneUy1ac8Rp aF9I/J6f2ErNFRv0GdadxL+7I1fLcr9uHbckIqulpMfG2/YjLzgP+gs3DIiM498F Xcd/KM/uz8twh+dzv4UM5BoO3SpyfxLJSIQNLYgNHZdJbDJMW7+MhaCJPoZM8mtz GjUFgGGUMLL0= 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=KK4nsDtQ1Ha3pj9MFjTbcvPu1w4=; b=UYlRr ax6XjOgh1K0TppWZPZNOuCeywTXEObQ0Ml86DGoJZ53ch4w7pQww80NTRX+uaHAf zmI6uT4/+mmL/25lXi0jTesXuNjr6qbYZytnyDm37p12RAL/FlwPCm5Gq29LmmMH A2g/guuGGg8KPdYRHNmfrWXjo5gGfEMOk/zSh4= Received: (qmail 115135 invoked by alias); 12 Sep 2019 12:15:55 -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 115127 invoked by uid 89); 12 Sep 2019 12:15:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 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=pthread_cancel X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Speedup various nptl/tst-cancel20 and nptl/tst-cancel21 tests. Date: Thu, 12 Sep 2019 14:15:48 +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-0000039B6471 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091212-0029-0000-0000-0000245DCFAD Message-Id: Hi, each of thease tests - tst-cancel20, tst-cancelx20, tst-cancel21, tst-cancelx21 and tst-cancel21-static - runs for 8s. do_one_test is called 4 times. Either in do_one_test (tst-cancel20.c) or in tf (tst-cancel21.c) "sleep (1)" is called 2 times. This patch reduces the sleep time. Using usleep (5ms) leads to a runtime of one tst-cancel... invocation of roughly 40ms instead of 8s. As the nptl tests run in sequence, this patch saves roughly 39s of runtime for "make check". Bye, Stefan ChangeLog: * nptl/tst-cancel20.c (do_one_test): Reduce sleep times. * nptl/tst-cancel21.c (tf): Likewise. commit e89d0d6819799737a6133d3994e6f38d00c745e4 Author: Stefan Liebler Date: Wed Sep 11 09:43:08 2019 +0200 Speedup various nptl/tst-cancel20 and nptl/tst-cancel21 tests. Each of thease tests - tst-cancel20, tst-cancelx20, tst-cancel21, tst-cancelx21 and tst-cancel21-static - runs for 8s. do_one_test is called 4 times. Either in do_one_test (tst-cancel20.c) or in tf (tst-cancel21.c) "sleep (1)" is called 2 times. This patch reduces the sleep time. Using usleep (5ms) leads to a runtime of one tst-cancel... invocation of roughly 40ms instead of 8s. As the nptl tests run in sequence, this patch saves roughly 39s of runtime for "make check". ChangeLog: * nptl/tst-cancel20.c (do_one_test): Reduce sleep times. * nptl/tst-cancel21.c (tf): Likewise. diff --git a/nptl/tst-cancel20.c b/nptl/tst-cancel20.c index 96dfb71fa9..abf250d508 100644 --- a/nptl/tst-cancel20.c +++ b/nptl/tst-cancel20.c @@ -126,7 +126,7 @@ do_one_test (void) return 1; } - sleep (1); + usleep (5000); r = pthread_kill (th, SIGHUP); if (r) @@ -137,7 +137,7 @@ do_one_test (void) } while (in_sh_body == 0) - sleep (1); + usleep (5000); if (pthread_cancel (th) != 0) { diff --git a/nptl/tst-cancel21.c b/nptl/tst-cancel21.c index 361510b027..371759c551 100644 --- a/nptl/tst-cancel21.c +++ b/nptl/tst-cancel21.c @@ -104,7 +104,7 @@ tf (void *arg) exit (1); } - sleep (1); + usleep (5000); r = pthread_kill (th, SIGHUP); if (r) @@ -115,7 +115,7 @@ tf (void *arg) } while (in_sh_body == 0) - sleep (1); + usleep (5000); if (pthread_cancel (th) != 0) {