JDK-8292591 : Experimentally add back barrier-less Java thread transitions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-08-18
  • Updated: 2024-08-01
  • Resolved: 2022-09-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b15Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
In some extreme workloads where JNI is used for calling a very, very short function very, very often, there is a very small performance benefit from using the unsupported JNI critical.

JNI critical does not properly leave the VM when going to native (which can block for safepoints) and gives access to the heap directly in case of a primitive array.

JNI critical has been removed.

The primitive array case seems not be well known (good!) and we have not seen any concerns about that.
But the lack of faster JNI calls has been noted.

If we only need the faster transitions the best idea for it is to add back barrier-less transitions. It is almost as fast as JNI critical, but applies to all ordinary JNI methods. (JNI critical had simpler argument packing due to blocking safepoints)

This time we want to:
- Use documented and supported OS features.
- Leave it as an experimental feature, and document that it may be removed in any release without prior notice.

Comments
Changeset: 1e1db5de Author: Robbin Ehn <rehn@openjdk.org> Date: 2022-09-13 08:31:45 +0000 URL: https://git.openjdk.org/jdk/commit/1e1db5debd5e37650d7d7345544104a9050f418c
13-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10123 Date: 2022-09-01 16:47:58 +0000
01-09-2022