RFR: JDK-8269651: ZGC: Optimize away gc locker in mark start

Hamlin Li mli at openjdk.java.net
Thu Jul 1 01:40:59 UTC 2021

On Wed, 30 Jun 2021 11:58:56 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Currently, ZGC involves gc locker in mark-start and relocate-start.
> It seems gc locker in mark-start is not necessary anymore.
> This is to remove this unnecessary(??) gc locker before further optimization is discussed.

Thanks for clarification.
When I invesitgated JDK-8269423, I also thought good/bad mask changing might be the reason to keep gc locker at MarkStart.

But after further investigation, it seems to me that for GetXxxCritical it's OK to remove gc locker at MarkStart.
The reasons are:
1. GetXxxCritical returns the native address, and whether good or bad these addresses are valid address for native code (am I right here?), unless it's relocated later at Relocate.
2. The gc locker in RelocateStart will block until ReleaseXxxCritical, so gc locker in RelocateStart ensures the native address retrieved from GetXxxCritical to be valid.

Please kindly correct my comments above.


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

More information about the hotspot-gc-dev mailing list