linux/crypto
Eric Biggers a7008584ab crypto: api - optimize algorithm registration when self-tests disabled
Currently, registering an algorithm with the crypto API always causes a
notification to be posted to the "cryptomgr", which then creates a
kthread to self-test the algorithm.  However, if self-tests are disabled
in the kconfig (as is the default option), then this kthread just
notifies waiters that the algorithm has been tested, then exits.

This causes a significant amount of overhead, especially in the kthread
creation and destruction, which is not necessary at all.  For example,
in a quick test I found that booting a "minimum" x86_64 kernel with all
the crypto options enabled (except for the self-tests) takes about 400ms
until PID 1 can start.  Of that, a full 13ms is spent just doing this
pointless dance, involving a kthread being created, run, and destroyed
over 200 times.  That's over 3% of the entire kernel start time.

Fix this by just skipping the creation of the test larval and the
posting of the registration notification entirely, when self-tests are
disabled.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2022-11-25 17:39:18 +08:00
..
asymmetric_keys
async_tx treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
842.c
acompress.c
adiantum.c
aead.c
aegis.h
aegis128-core.c
aegis128-neon-inner.c
aegis128-neon.c
aes_generic.c
aes_ti.c
af_alg.c crypto: af_alg - Support symmetric encryption via keyring keys 2022-10-28 12:36:34 +08:00
ahash.c
akcipher.c
algapi.c crypto: api - optimize algorithm registration when self-tests disabled 2022-11-25 17:39:18 +08:00
algboss.c
algif_aead.c
algif_hash.c
algif_rng.c
algif_skcipher.c
ansi_cprng.c
anubis.c
api.c crypto: api - optimize algorithm registration when self-tests disabled 2022-11-25 17:39:18 +08:00
arc4.c
aria_generic.c crypto: aria - prepare generic module for optimized implementations 2022-09-24 16:14:44 +08:00
authenc.c
authencesn.c
blake2b_generic.c
blowfish_common.c
blowfish_generic.c
camellia_generic.c
cast5_generic.c
cast6_generic.c
cast_common.c
cbc.c
ccm.c crypto: ccm - use local variables instead of indirect references 2022-10-21 19:05:23 +08:00
cfb.c
chacha20poly1305.c
chacha_generic.c
cipher.c
cmac.c
compress.c
crc32_generic.c
crc32c_generic.c
crc64_rocksoft_generic.c
crct10dif_common.c
crct10dif_generic.c
cryptd.c crypto: cryptd - Use request context instead of stack for sub-request 2022-11-18 16:59:34 +08:00
crypto_engine.c
crypto_null.c
crypto_user_base.c
crypto_user_stat.c
ctr.c
cts.c
curve25519-generic.c
deflate.c
des_generic.c
dh.c
dh_helper.c
drbg.c
ecb.c
ecc.c
ecc_curve_defs.h
ecdh.c
ecdh_helper.c
ecdsa.c
ecdsasignature.asn1
echainiv.c
ecrdsa.c
ecrdsa_defs.h
ecrdsa_params.asn1
ecrdsa_pub_key.asn1
essiv.c
fcrypt.c
fips.c
gcm.c
geniv.c
ghash-generic.c
hash_info.c
hctr2.c
hmac.c
internal.h
jitterentropy-kcapi.c
jitterentropy.c
jitterentropy.h
Kconfig crypto: move gf128mul library into lib/crypto 2022-11-11 18:14:59 +08:00
kdf_sp800108.c
keywrap.c
khazad.c
kpp.c
lrw.c
lz4.c
lz4hc.c
lzo-rle.c
lzo.c
Makefile crypto: move gf128mul library into lib/crypto 2022-11-11 18:14:59 +08:00
md4.c
md5.c
michael_mic.c
nhpoly1305.c
ofb.c
pcbc.c
pcrypt.c
poly1305_generic.c
polyval-generic.c
proc.c
ripemd.h
rmd160.c
rng.c
rsa-pkcs1pad.c
rsa.c
rsa_helper.c
rsaprivkey.asn1
rsapubkey.asn1
scatterwalk.c
scompress.c
seed.c
seqiv.c
serpent_generic.c
sha1_generic.c
sha3_generic.c
sha256_generic.c
sha512_generic.c
shash.c
simd.c
skcipher.c crypto: skcipher - Allow sync algorithms with large request contexts 2022-11-18 16:59:34 +08:00
sm2.c
sm2signature.asn1
sm3.c
sm3_generic.c
sm4.c
sm4_generic.c
streebog_generic.c
tcrypt.c crypto: tcrypt - add SM4 cts-cbc/xts/xcbc test 2022-11-04 17:34:21 +08:00
tcrypt.h
tea.c
testmgr.c crypto: testmgr - add SM4 cts-cbc/xts/xcbc test vectors 2022-11-04 17:34:21 +08:00
testmgr.h crypto: testmgr - add SM4 cts-cbc/xts/xcbc test vectors 2022-11-04 17:34:21 +08:00
twofish_common.c
twofish_generic.c
vmac.c
wp512.c
xcbc.c
xctr.c
xor.c
xts.c
xxhash_generic.c
zstd.c