[openssl/openssl] fc570b: Avoid taking a write lock in ossl_provider_doall_a...

Matt Caswell noreply at github.com
Thu Jun 1 23:15:10 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: fc570b2605b8eb18c3903543aaf0234b1f698c8e
      https://github.com/openssl/openssl/commit/fc570b2605b8eb18c3903543aaf0234b1f698c8e
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-06-02 (Fri, 02 Jun 2023)

  Changed paths:
    M crypto/provider_core.c

  Log Message:
  -----------
  Avoid taking a write lock in ossl_provider_doall_activated()

We refactor ossl_provider_doall_activated() so that we only need to take
a read lock instead of a write lock for the flag_lock. This should improve
performance by avoiding the lock contention. We achieve this by protecting
the activatecnt via atomics rather than via a lock and by avoiding the full
provider activation/deactivation procedure where it is not needed.

Partial fix for #20286

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20927)




More information about the openssl-commits mailing list