Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: testmgr - add some more preemption points

Call cond_resched() after each fuzz test iteration. This avoids stall
warnings if fuzz_iterations is set very high for testing purposes.

While we're at it, also call cond_resched() after finishing testing each
test vector.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
e63e1b0d 177f87d0

+6
+6
crypto/testmgr.c
··· 1496 1496 req, desc, tsgl, hashstate); 1497 1497 if (err) 1498 1498 return err; 1499 + cond_resched(); 1499 1500 } 1500 1501 } 1501 1502 #endif ··· 1765 1764 hashstate); 1766 1765 if (err) 1767 1766 goto out; 1767 + cond_resched(); 1768 1768 } 1769 1769 err = test_hash_vs_generic_impl(driver, generic_driver, maxkeysize, req, 1770 1770 desc, tsgl, hashstate); ··· 2030 2028 &cfg, req, tsgls); 2031 2029 if (err) 2032 2030 return err; 2031 + cond_resched(); 2033 2032 } 2034 2033 } 2035 2034 #endif ··· 2270 2267 tsgls); 2271 2268 if (err) 2272 2269 return err; 2270 + cond_resched(); 2273 2271 } 2274 2272 return 0; 2275 2273 } ··· 2613 2609 &cfg, req, tsgls); 2614 2610 if (err) 2615 2611 return err; 2612 + cond_resched(); 2616 2613 } 2617 2614 } 2618 2615 #endif ··· 2813 2808 tsgls); 2814 2809 if (err) 2815 2810 return err; 2811 + cond_resched(); 2816 2812 } 2817 2813 return 0; 2818 2814 }