From patchwork Thu Sep 12 12:16:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1161549 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-105166-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="PHRbO3TS"; 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 46Td6G01RHz9s4Y for ; Thu, 12 Sep 2019 22:16:21 +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=SJ8xkdMAJzDLWEfCcmtJK5o2/OgVuWj sPvQFvOzAMoozMxZeVtsYidHtz8vxdKOPQzVkKj7PWO3vgIVPL8uUiaHs5ZvMTMd NUl2TKFgVg5WSfp21QSpv1YC/T+iLP7PFkZxTBeakYahFGYxy60TxbiITiCaq8Nh PPdw2uUvPj3Q= 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=jvkezMSVKBQIO+49Wg+3taJo1QI=; b=PHRbO 3TSIpYNHulaaXMnW0NBpmCEDrVSvUMdjI9pOqSaaTWMtt0xaqNCd2gKA3+IopsFI TyN9t4/LzMnHAswBGaTEc8TcmnN6nGq9wEO4WibZ1YstN6KqFXYY0cS/ujGdgpYB B3vNBMx6aVfG89c837T/LfIBDh2gVYQGQfeOhM= Received: (qmail 117111 invoked by alias); 12 Sep 2019 12:16:13 -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 117049 invoked by uid 89); 12 Sep 2019 12:16:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 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.5, HX-Languages-Length:1933 X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Speedup nptl/tst-rwlock19. Date: Thu, 12 Sep 2019 14:16:05 +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-00000364DC09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091212-4276-0000-0000-0000387736A6 Message-Id: <63377b64-9da9-0588-e3d5-92a4f1a1e6d0@linux.ibm.com> Hi, the test creates 15 threads which are trying 5000x to pthread_rwlock_rdlock a modified lock where the number of readers is set to max - 5. If locked successfully, it sleeps for 1ms. The test succeeds if the lock was rdlock'ed successfully for at least one time and it has failed at least once with EAGAIN and the number of readers needs to be max - 5 again after all threads have joined. The test is currently running for 5 seconds. Thus this patch reduces the READTRIES from 5000 to 100 and is increasing the DELAY from 1ms to 5ms. Then the test runs for roughly 0.5 seconds. Bye, Stefan ChangeLog: * nptl/tst-rwlock19.c (READTRIES): Reduce to 100. (DELAY) Increase to 5000000. commit 2792fbbc18473026b2552cc8c2664146233760c4 Author: Stefan Liebler Date: Thu Sep 12 09:19:01 2019 +0200 Speedup nptl/tst-rwlock19. The test creates 15 threads which are trying 5000x to pthread_rwlock_rdlock a modified lock where the number of readers is set to max - 5. If locked successfully, it sleeps for 1ms. The test succeeds if the lock was rdlock'ed successfully for at least one time and it has failed at least once with EAGAIN and the number of readers needs to be max - 5 again after all threads have joined. The test is currently running for 5 seconds. Thus this patch reduces the READTRIES from 5000 to 100 and is increasing the DELAY from 1ms to 5ms. Then the test runs for roughly 0.5 seconds. ChangeLog: * nptl/tst-rwlock19.c (READTRIES): Reduce to 100. (DELAY) Increase to 5000000. diff --git a/nptl/tst-rwlock19.c b/nptl/tst-rwlock19.c index 19d40c11ca..3f98ef69f6 100644 --- a/nptl/tst-rwlock19.c +++ b/nptl/tst-rwlock19.c @@ -26,9 +26,9 @@ #define NREADERS 15 -#define READTRIES 5000 +#define READTRIES 100 -#define DELAY 1000000 +#define DELAY 5000000 static pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER; static int eagain_returned = 0;