From patchwork Tue Aug 28 14:40:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 962981 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=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 420BHr3CWFz9ryn for ; Wed, 29 Aug 2018 00:40:24 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A432B3E720E for ; Tue, 28 Aug 2018 16:40:21 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id BD6333E605D for ; Tue, 28 Aug 2018 16:40:17 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 59F5F6001F3 for ; Tue, 28 Aug 2018 16:40:17 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F93EC12BA; Tue, 28 Aug 2018 14:40:16 +0000 (UTC) Received: from dustball.brq.redhat.com (unknown [10.43.17.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 540E4112D17B; Tue, 28 Aug 2018 14:40:15 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it, liwan@redhat.com, chrubis@suse.cz, rpalethorpe@suse.com Date: Tue, 28 Aug 2018 16:40:07 +0200 Message-Id: In-Reply-To: <920f7a911d8b32c3c2e673a9c608ded2526a616d.1535466715.git.jstancek@redhat.com> References: <920f7a911d8b32c3c2e673a9c608ded2526a616d.1535466715.git.jstancek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 28 Aug 2018 14:40:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 28 Aug 2018 14:40:16 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jstancek@redhat.com' RCPT:'' X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH RFC v3 3/3] move_pages12: end early if runtime gets close to test time X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Most systems can complete this reproducer in standard test time. Small groups of systems (e.g. aarch64 with 512M hugepages) are hitting a timeout. Add a check for elapsed time and end test early if we are getting close (80%). Fixes: #387 Signed-off-by: Jan Stancek --- testcases/kernel/syscalls/move_pages/move_pages12.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/testcases/kernel/syscalls/move_pages/move_pages12.c b/testcases/kernel/syscalls/move_pages/move_pages12.c index 43acb42aabb1..3f60c0ca47fc 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages12.c +++ b/testcases/kernel/syscalls/move_pages/move_pages12.c @@ -101,6 +101,7 @@ static void do_test(void) int i; pid_t cpid = -1; int status; + unsigned int _20_percent = (tst_timeout_remaining() / 5); addr = SAFE_MMAP(NULL, TEST_PAGES * hpsz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); @@ -123,14 +124,15 @@ static void do_test(void) memset(addr, 0, TEST_PAGES * hpsz); SAFE_MUNMAP(addr, TEST_PAGES * hpsz); - } - if (i == LOOPS) { - SAFE_KILL(cpid, SIGKILL); - SAFE_WAITPID(cpid, &status, 0); - if (!WIFEXITED(status)) - tst_res(TPASS, "Bug not reproduced"); + if (tst_timeout_remaining() < _20_percent) + break; } + + SAFE_KILL(cpid, SIGKILL); + SAFE_WAITPID(cpid, &status, 0); + if (!WIFEXITED(status)) + tst_res(TPASS, "Bug not reproduced"); } static void alloc_free_huge_on_node(unsigned int node, size_t size)