JDK-8305236 : Some LoadLoad barriers in the interpreter are unnecessary after JDK-8220051
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17,20,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: aarch64,riscv
  • Submitted: 2023-03-30
  • Updated: 2023-07-10
  • Resolved: 2023-04-21
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 17 JDK 21
17.0.9Fixed 21 b20Fixed
Related Reports
Relates :  
Description
After JDK-8220051, Interpreter::notice_safepoints() only be executed at a safe point, so LoadLoad barrier is useless.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1427 Date: 2023-06-13 09:43:25 +0000
20-06-2023

Fix Request (17u) Provides a minor performance improvement in interpreter, by avoiding unnecessary memory barrier. AArch64 parts apply cleanly; RISC-V parts are missing due to missing port. Testing passes. Benchmark in this RFE improves.
19-06-2023

The simplest way to demonstrate the minor cost of the redundant barrier on branch path is: ``` public class Branchy { public static void main(String... args) { for (int c = 0; c < 10_000_000; c++) { } } } ``` On m6g.4xlarge: ``` Performance counter stats for 'build/baseline/bin/java -Xint Branchy' (100 runs): 125.43 msec task-clock:u # 0.977 CPUs utilized ( +- 0.25% ) 0 context-switches:u # 0.000 K/sec 0 cpu-migrations:u # 0.000 K/sec 3,369 page-faults:u # 0.027 M/sec ( +- 0.01% ) 275,721,009 cycles:u # 2.198 GHz ( +- 0.28% ) 658,380,244 instructions:u # 2.39 insn per cycle ( +- 0.00% ) <not supported> branches:u 236,032 branch-misses:u ( +- 0.20% ) 0.128448 +- 0.000312 seconds time elapsed ( +- 0.24% ) Performance counter stats for 'build/linux-aarch64-server-release/images/jdk/bin/java -Xint Branchy' (100 runs): 111.74 msec task-clock:u # 0.978 CPUs utilized ( +- 0.31% ) 0 context-switches:u # 0.000 K/sec 0 cpu-migrations:u # 0.000 K/sec 3,378 page-faults:u # 0.030 M/sec ( +- 0.01% ) 241,446,765 cycles:u # 2.161 GHz ( +- 0.35% ) 648,373,730 instructions:u # 2.69 insn per cycle ( +- 0.00% ) <not supported> branches:u 237,119 branch-misses:u ( +- 0.19% ) 0.114232 +- 0.000345 seconds time elapsed ( +- 0.30% ) ``` Saves about 1 insn and 3 cycles per branch in interpreter code.
19-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1468 Date: 2023-06-19 07:17:05 +0000
19-06-2023

Changeset: 2c70828e Author: sunguoyun <sunguoyun@loongson.cn> Committer: Fei Yang <fyang@openjdk.org> Date: 2023-04-21 00:47:24 +0000 URL: https://git.openjdk.org/jdk/commit/2c70828e7dc78783c174e3f93c94b6e2439d2dfb
21-04-2023

[~dcubed] The only use of notice_safepoints() now is by JVMTI - that why I think this was filed under JVMTI.
04-04-2023

I'm not sure why this bug started in hotspot/jvmti. The PR shows changes to interpreter code so I'm moving this bug to hotspot/runtime for initial triage.
30-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13244 Date: 2023-03-30 12:49:09 +0000
30-03-2023