RFR: 8268390: G1 concurrent gc upgrade to full gc not working

Stefan Johansson sjohanss at openjdk.java.net
Wed Jun 9 16:52:28 UTC 2021


Please review this small change to enable concurrent GCs to be upgraded to Full collections when there are no free regions.

**Summary** 
During the review of PR #4342 it was noted that we currently never upgrade concurrent GCs (from `VM_G1TryInitiateConcMark::doit()`) to full collections. In `should_upgrade_to_full_gc()` there was a check to always return false for "concurrent" GC-causes. There is no obviously good reason for this, and this change will enable concurrent GCs to be upgraded.

This could not be included in PR #4342 because that would make us hit the same problem as reported in [JDK-8195158](https://bugs.openjdk.java.net/browse/JDK-8195158). The fix back then was to not upgrade concurrent GCs. The approach used now, which was added by PR #4357, is to use another GC cause for upgraded GCs. 

What this change does is basically just removing the `should_do_concurrent_full_gc()` check from `should_upgrade_to_full_gc()` and once that is done `has_regions_left_for_allocation()` might as well be folded into `should_upgrade_to_full_gc()`

**Testing**
Manual testing to verify this does not cause the assertion failure from JDK-8195158. Currently running Mach5 testing.

-------------

Commit messages:
 - 8268390: G1 concurrent gc upgrade to full gc not working

Changes: https://git.openjdk.java.net/jdk/pull/4435/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4435&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8268390
  Stats: 19 lines in 3 files changed: 1 ins; 13 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4435.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4435/head:pull/4435

PR: https://git.openjdk.java.net/jdk/pull/4435


More information about the hotspot-gc-dev mailing list