public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] pcrypt_aead01: break early when approaching timeout
@ 2019-10-15 13:30 Jan Stancek
  2019-10-15 15:01 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2019-10-15 13:30 UTC (permalink / raw)
  To: 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 <jstancek@redhat.com>
---
 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@"
+				"%d iterations", i);
+			break;
+		}
 	}
 
 	tst_res(TPASS, "Nothing bad appears to have happened");
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-18  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-15 13:30 [LTP] [PATCH] pcrypt_aead01: break early when approaching timeout Jan Stancek
2019-10-15 15:01 ` Cyril Hrubis
2019-10-18  7:18   ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox