Skip to content

Commit

Permalink
crypto: testmgr - add some more preemption points
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Jun 13, 2019
1 parent 177f87d commit e63e1b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec,
req, desc, tsgl, hashstate);
if (err)
return err;
cond_resched();
}
}
#endif
Expand Down Expand Up @@ -1764,6 +1765,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs,
hashstate);
if (err)
goto out;
cond_resched();
}
err = test_hash_vs_generic_impl(driver, generic_driver, maxkeysize, req,
desc, tsgl, hashstate);
Expand Down Expand Up @@ -2028,6 +2030,7 @@ static int test_aead_vec(const char *driver, int enc,
&cfg, req, tsgls);
if (err)
return err;
cond_resched();
}
}
#endif
Expand Down Expand Up @@ -2267,6 +2270,7 @@ static int test_aead(const char *driver, int enc,
tsgls);
if (err)
return err;
cond_resched();
}
return 0;
}
Expand Down Expand Up @@ -2609,6 +2613,7 @@ static int test_skcipher_vec(const char *driver, int enc,
&cfg, req, tsgls);
if (err)
return err;
cond_resched();
}
}
#endif
Expand Down Expand Up @@ -2808,6 +2813,7 @@ static int test_skcipher(const char *driver, int enc,
tsgls);
if (err)
return err;
cond_resched();
}
return 0;
}
Expand Down

0 comments on commit e63e1b0

Please sign in to comment.