pcrypt_aead01: break early when approaching timeout
PATCH 1/1 pcrypt_aead01: break early when approaching timeout
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.
--- testcases/kernel/crypto/pcrypt_aead01.c | 6 ++++++ 1 file changed, 6 insertions(+)
testcases/kernel/crypto/pcrypt_aead01.c +6 -0
@@ -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" );
Signature · 1 line
1.8.3.1
PATCH 1/1 pcrypt_aead01: break early when approaching timeout
Hi!
Acked.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 pcrypt_aead01: break early when approaching timeout
----- Original Message -----
Quoted 3 lines
Hi!
Acked.
Pushed.