RFR: 8262316: Reducing locks in RSA Blinding

Anthony Scarpino ascarpino at openjdk.java.net
Wed Mar 31 21:54:28 UTC 2021


Hi,

I need a review of the locking change to the RSA blinding code. The problem was reported that multithreaded performance suffered because there was one global lock on the many blindings operation.  The change reduces locking by using a ConcurrentLinkedQueue to store the different BlindingParameters that other threads maybe using.  The queue size is limited to prevent sudden surges in stored BlindingParameters and a WeakHashMap is still used so the objects can be freed when no longer used.  Performance doubles under high load.

thanks

Tony

-------------

Commit messages:
 - change putIfAbsent usage to minimize competing threads
 - add loop to check the queue on reset
 - add comment, cleanup
 - minor update
 - queue idea

Changes: https://git.openjdk.java.net/jdk/pull/3296/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3296&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262316
  Stats: 82 lines in 1 file changed: 39 ins; 16 del; 27 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3296.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3296/head:pull/3296

PR: https://git.openjdk.java.net/jdk/pull/3296


More information about the security-dev mailing list