JDK-8289692 : JFR: Thread checkpoint no longer enforce mutual exclusion post Loom integration
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 19,20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-07-04
  • Updated: 2022-12-05
  • Resolved: 2022-07-11
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 19 JDK 20
19 b31Fixed 20Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Before integrating Loom and Virtual Threads, threads writing checkpoint meta-information claimed a checkpoint buffer from a list categorized as thread-local.
Buffers on this list are not reset eagerly as part of a flushpoint but only as part of chunk rotation, where the JFR Recorder Thread has exclusive access by issuing a prior epoch shift.

With Loom, the thread-local buffers are exclusively dedicated to meta-information for Virtual Threads.
The meta-information about the JVM thread, for example, the carrier thread, is written to a buffer located on the list categorized as global. Buffers on this list are reset eagerly during flushpoints. Before Loom, an invariant for this global list was that only the JFR Recorder Thread used it.
This invariant no longer holds. The JFR Recorder Thread will reset buffers on this list without protection and can do so in the middle of another thread's attempted writes. Some consequences are asserts in debug builds and data loss in product builds.

Some mutex mechanism for the buffers on the global list must be re-introduced to prevent the JFR Recorder Thread from resetting buffers currently in use.
Comments
Changeset: 04942914 Author: Markus Grönlund <mgronlun@openjdk.org> Date: 2022-07-11 09:11:58 +0000 URL: https://git.openjdk.org/jdk19/commit/0494291490b6cd23d228f39199a3686cc9731ec0
11-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk19/pull/109 Date: 2022-07-05 10:47:48 +0000
05-07-2022