8268265: MutableSpaceUsedHelper::take_sample() hits assert(left >= right) failed: avoid overflow #65
Conversation
|
@kimbarrett The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@kimbarrett This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the
|
/integrate |
Going to push as commit c98d508. |
@kimbarrett Pushed as commit c98d508. |
Please review this change to PerfData-based heap usage reporting by SerialGC
and ParallelGC.
For both of these collectors, the periodic heap usage sampling and reporting
by the Watcher thread involves sampling the difference between each space's
current allocation pointer and its base pointer. But the Watcher thread
runs during GC safepoints, which means that sampling may occasionally occur
while the GC is in the process of updating the space being sampled. This
can result in a sample with a bogus value or even an assertion failure after
JDK-8260046.
Other collectors seem to avoid this by sampling and recording the heap usage
value at specific synchronous times rather than asynchronously by the
Watcher thread.
There isn't a particularly good place for synchronous updates for ParallelGC
and SerialGC, so this change doesn't do so. Instead, it makes the existing
asynchronous updates safe from interference by an in-progress GC. This is
done by having the update done under the Heap_lock. Introducing a more
fine-grained lock has the same problem as doing synchronous updates. Rather
than possibly blocking the sampling Watcher thread for the duration of a GC,
it tries to lock the Heap_lock and skips sampling if it's not available.
Testing:
mach5 tier1-3, 5, 7 (3,5,7 are where focused Serial and ParallelGC testing is done).
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/65/head:pull/65
$ git checkout pull/65
Update a local copy of the PR:
$ git checkout pull/65
$ git pull https://git.openjdk.java.net/jdk17 pull/65/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 65
View PR using the GUI difftool:
$ git pr show -t 65
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/65.diff