From patchwork Tue Oct 15 13:30:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 1177024 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46sxC52M8vz9sP7 for ; Wed, 16 Oct 2019 00:30:56 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 99FD33C225A for ; Tue, 15 Oct 2019 15:30:48 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 98B193C18B5 for ; Tue, 15 Oct 2019 15:30:46 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 86A3D140172C for ; Tue, 15 Oct 2019 15:30:45 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D96BCC057E3C for ; Tue, 15 Oct 2019 13:30:43 +0000 (UTC) Received: from dustball.brq.redhat.com (unknown [10.43.17.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58F735D6A9 for ; Tue, 15 Oct 2019 13:30:43 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it Date: Tue, 15 Oct 2019 15:30:36 +0200 Message-Id: <031b8dbecf1c08d3b00f876943b744274e6a5785.1571146155.git.jstancek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 15 Oct 2019 13:30:43 +0000 (UTC) X-Virus-Scanned: clamav-milter 0.99.2 at in-6.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-6.smtp.seeweb.it Subject: [LTP] [PATCH] pcrypt_aead01: break early when approaching timeout X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" PowerNV (P9 witherspoon, 176CPUs) systems running latest upstream kernel (5.3.6) have been observed to come very close to test timeout and also sporadically fail, because they couldn't complete 10000 iterations in time. Each iteration of test leads to modprobe of cryptomgr and crypto framework running number of tests, taking up to ~70ms per iteration. Looking at traces, a significant contributor is wakeup time. After one crypto test is done, it takes ~0.5ms for other tests to resume: (gettimeofday_us) 1571141551769329 7 kworker/1:1(897):<-crypto_req_done 1571141551769843 1603 cryptomgr_test(3813): Booting with powersave=off cuts this latency significantly, single iteration of test completes in ~10ms. But changing kernel defaults isn't very practical solution, hence patch is watching for timeout approaching and breaks the loop early. Signed-off-by: Jan Stancek --- testcases/kernel/crypto/pcrypt_aead01.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testcases/kernel/crypto/pcrypt_aead01.c b/testcases/kernel/crypto/pcrypt_aead01.c index d9c27f69dce7..3dc8c58c2817 100644 --- a/testcases/kernel/crypto/pcrypt_aead01.c +++ b/testcases/kernel/crypto/pcrypt_aead01.c @@ -54,6 +54,12 @@ void run(void) TEST(tst_crypto_del_alg(&ses, &a)); if (TST_RET) tst_brk(TBROK | TRERRNO, "del_alg"); + + if (tst_timeout_remaining() < 10) { + tst_res(TINFO, "Time limit reached, stopping at " + "%d iterations", i); + break; + } } tst_res(TPASS, "Nothing bad appears to have happened");