summaryrefslogtreecommitdiff
path: root/crypto/algboss.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-11-13 16:12:33 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2022-11-25 17:39:18 +0800
commit7fb643db495f891002e521f7320943d8f1b2720f (patch)
treeab6e5bb15ad5505cf75f1f90cd327e1a6bade2c5 /crypto/algboss.c
parentcf62456b8198d5e0c641fa5420f573acf1d3c61d (diff)
downloadlinux-crypto-7fb643db495f891002e521f7320943d8f1b2720f.tar.gz
linux-crypto-7fb643db495f891002e521f7320943d8f1b2720f.zip
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>
Diffstat (limited to 'crypto/algboss.c')
0 files changed, 0 insertions, 0 deletions