JDK-8287555 : Tighten G1 G1BlockOffsetTable::block_start() code
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 19
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2022-05-31
  • Updated: 2022-08-10
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Description
Since JDK-8276098 the BOT for G1 is always precise and accurate at least for old gen regions.

Still, G1BlockOffsetTablePart::block_start, even after getting the BOT table element value, tries to make sure that the object it found crosses into the card we want to find.

This involves getting block size and eventually looping to advance the current position so that we get to a block crossing the card.

This seems unnecessary if the address we ask the block start for is card-aligned as the BOT is always precise and accurate at least for old gen regions.
For refinement, the address is aligned 100% of times; some testing showed that in card scanning this is 99%+ of times the case as a non-card aligned address would need e.g. objects that span multiple cards which is (as the statistics show) really rare.

Similarly the documentation for G1BlockOffsetTable::block_start() seems outdated.

See if the code can be simplified given these new constraints for some (minor) performance gain.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9059 Date: 2022-06-07 11:46:47 +0000
23-06-2022