JDK-8290700 : Optimize AArch64 nmethod entry barriers
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: aarch64
  • Submitted: 2022-07-20
  • Updated: 2022-07-28
  • Resolved: 2022-07-25
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 b08Fixed
Related Reports
Blocks :  
Description
The original nmethod entry barrier supported only concurrent patching of data and was used by ZGC to solve concurrent class unloading problems. Now it is starting to see more uses. Notable, loom uses nmethod entry barriers to figure out what nmethods have been seen on-stack, needed to remove nmethods. However, the concurrent data patching variation was too slow for loom, so I brought over a faster nmethod entry barrier that we use in the generational ZGC repo, which additionally handles concurrent patching of data and instructions, which is needed there.
However, for the uses in loom, the classic GCs don't really patch anything interesting concurrently. This leads to the following possible enhancements:

1. Make a dedicated nmethod entry barrier for GCs that don't patch data nor code concurrently, consisting of basically only a conditional branch.

2. Move the "guard" word and call into the VM trampoline, to an out-of-line stub, ensuring instruction caches are not polluted by non-hot instructions at the nmethod entry. Some machines also better optimize the branch-not-taken path of conditional branches.
Comments
Changeset: 228e8e94 Author: Erik Ă–sterlund <eosterlund@openjdk.org> Date: 2022-07-25 07:08:46 +0000 URL: https://git.openjdk.org/jdk/commit/228e8e94fe048e56d5513b150060c9b54f15642c
25-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9574 Date: 2022-07-20 16:54:53 +0000
20-07-2022