This repository was archived by the owner on Sep 19, 2023. It is now read-only.
8288592: JFR: Thread checkpoint no longer enforce mutual exclusion post Loom integration #108
+49
−35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings,
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. This change set adds back proper protection.
Testing: jdk_jfr, stress
Thanks
Markus
Progress
Integration blocker
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk19 pull/108/head:pull/108
$ git checkout pull/108
Update a local copy of the PR:
$ git checkout pull/108
$ git pull https://git.openjdk.org/jdk19 pull/108/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 108
View PR using the GUI difftool:
$ git pr show -t 108
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/108.diff