8381382: Shenandoah: assert(capacity > 0) failed: free regions must have allocation capacity#30615
8381382: Shenandoah: assert(capacity > 0) failed: free regions must have allocation capacity#30615pengxiaolong wants to merge 5 commits intoopenjdk:masterfrom
Conversation
…ave allocation capacity
|
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
|
@pengxiaolong This change is no longer ready for integration - check the PR body for details. |
|
@pengxiaolong The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
kdnilsen
left a comment
There was a problem hiding this comment.
Thanks for fixing this.
|
Converting it back to draft, I am working and testing on lightweight solution instead of creating ShenandoahLock instance for each region(it works, but it is bit overkill, I have been running the stress test for over 3 days, not crash so far). |
|
Closing this one, we have lightweight solution to fix this. |
The improvement I made in ticket https://bugs.openjdk.org/browse/JDK-8345423 makes trash region be recycled by GC workers w/o holding heap lock, this may cause assert from mutator memory allocation path in which mutator calls
ShenandoahFreeSet::assert_bounds()perform verifications, given GC workers recycle trashed region w/o heap lock, it is possible that one mutator can see inconsistent heap stats while a GC worker thread is recycling the same trashed region. It is not possible to happen for mem allocation except the verification, because before allocating inside a region, mutator always callsShenandoahHeapRegion::try_recycle_under_lock()which ensure the region is ready for use, but ShenandoahFreeSet::assert_bounds scans all regions rather than the region mutator tries to allocate in.I feel the assert used to rarely happen, because ShenandoahFreeSet::assert_bounds is called only when the region is retired due to insufficient memory, but this behavior was changed in recently commit which unifies the heap usage accounting, with it, mutator calls assert_bounds for every single allocation from heap, this make the assert to happen more often.
Test
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30615/head:pull/30615$ git checkout pull/30615Update a local copy of the PR:
$ git checkout pull/30615$ git pull https://git.openjdk.org/jdk.git pull/30615/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30615View PR using the GUI difftool:
$ git pr show -t 30615Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30615.diff
Using Webrev
Link to Webrev Comment