RFR: 8305898: Alternative self-forwarding mechanism [v2]

Roman Kennke rkennke at openjdk.org
Thu Aug 22 10:34:44 UTC 2024


> Currently, the Serial, Parallel and G1 GCs store a pointer to self into object headers, when promotion fails, to indicate that the object has been looked at, but failed promotion. This is problematic for compact object headers ([JDK-8294992](https://bugs.openjdk.org/browse/JDK-8294992)) because it would (temporarily) over-write the crucial class information, which we need for heap parsing. I would like to propose an alternative: use the bit #3 (previously biased-locking bit) to indicate that an object is 'self-forwarded'. That preserves the crucial class information in the upper bits of the header until the full header gets restored.
> 
> A side-effect of this is that we can get rid of the machinery to preserve headers across promotion failures in Serial and G1. (Parallel GC [ab]uses the preserved-headers structure to also find all the forwarded objects for header restoration. This could be changed, I suppose, but it is not trivial.) If you prefer, I could break-out the removal of the preserved-headers stuff into a separate PR.
> 
> This is in preparation of upstreaming compact object headers, and I intend to push it only once all the parts have been approved.
> 
> Testing:
>  - [x] tier1
>  - [x] tier2
>  - [x] tier3
>  - [x] tier4
>  - [x] Running in production @ AWS since >1year without troubles

Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:

  Remove special handling of non-self-fwded objects

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20603/files
  - new: https://git.openjdk.org/jdk/pull/20603/files/86239af3..ba54b2d9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20603&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20603&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/20603.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20603/head:pull/20603

PR: https://git.openjdk.org/jdk/pull/20603


More information about the hotspot-gc-dev mailing list