diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-03-10 09:38:09 +0000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2022-03-13 11:43:26 +1100 |
commit | c0b7dac66edde45b8da80918f5b5b62d1e766a0c (patch) | |
tree | 7f19cfd89b2ea3f1117b162bdfde6811f45c1b16 /include | |
parent | abdb2278d2b65ae87bee3121be83322e4219b396 (diff) |
EVP_MD performance fix (refcount cache contention)
Partial fix for #17064. Avoid excessive writes to the cache line
containing the refcount for an EVP_MD object to avoid extreme
cache contention when using a single EVP_MD at high frequency on
multiple threads. This changes performance in 3.0 from being double
that of 1.1 to only slightly higher than that of 1.1.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17857)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/evp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h index c5d3a930f7..6fb05309dc 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -900,7 +900,7 @@ int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq, int loadconfig, int mirrored); char *evp_get_global_properties_str(OSSL_LIB_CTX *libctx, int loadconfig); -void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force); +void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force, int keep_digest); /* Three possible states: */ # define EVP_PKEY_STATE_UNKNOWN 0 |