Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8046957

sunpkcs11 SessionManager improvement

    XMLWordPrintable

    Details

    • Author:
      Anthony Scarpino
    • JEP Type:
      Feature
    • Exposure:
      Open
    • Subcomponent:
    • Scope:
      JDK
    • Discussion:
      security dash dev at openjdk dot java dot net
    • Effort:
      S
    • Duration:
      L
    • Alert Status:
       Green

      Description

      Summary

      Replace non-concurrent list array with a concurrent queue for session management in sunpkcs11.

      Success Metric

      Increase the performance.

      Motivation

      Performance did not scale as well as it could have using microbenchmarks on some hardware platform.

      Description

      Session management in sunpkcs11 has been done with synchronized methods around an ArrayList which holds idle PKCS#11 session in a queue. This queue exists to provide better performance by giving open and idle sessions to new crypto operations. Without a queue, opening and closing PKCS#11 session through JNI to the native PKCS#11 library after each crypto operation would be CPU expensive.

      The change is to modernize this queue by using a concurrent class, ConcurrentLinkedDeque, and an AtomicInteger as a session counter. This leaves the locking solely in the queue where it is performed better, and releases five methods from being bottlenecked in synchronized locks.

      Testing

      Used provided test tool in JDK-7107611, no other testing is required.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ascarpino Anthony Scarpino
              Reporter:
              ascarpino Anthony Scarpino
              Owner:
              Anthony Scarpino Anthony Scarpino
              Reviewed By:
              Brian Goetz
              Endorsed By:
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Integration Due: