RFR: 8215754: ZGC: nmethod is not unlinked from Method before rendezvous handshake
Per Liden
per.liden at oracle.com
Thu Jan 10 13:59:14 UTC 2019
On 1/9/19 4:51 PM, Erik Österlund wrote:
> Hi,
>
> During concurrent class unloading in ZGC, the nmethod unloading goes
> through 3 phases:
>
> 1) Unlink all references to nmethods
> 2) Rendezvous handshake, to make sure all JavaThreads are in the new
> epoch where unlinking is done
> 3) Purge nmethods (by making them unloaded).
>
> However, we unfortunately unliked the code from the Method to the
> nmethod during #3 inside of the nmethod entry barrier instead of #1,
> causing JavaThreads to still observe these nmethods during phase #3,
> racing with make_unloaded(), and causing crashes in the nmethod entry
> barrier.
>
> The fix for this is to unlink the nmethod from the method during the
> first phase. I additionally eagerly unlink it in the nmethod barrier, to
> allow calls into unloading nmethods to not get stuck until the GC comes
> around to do it.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8215754
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8215754/webrev.00/
Looks good!
I also ran a slightly easier version of this patch, which had the same
effect, through tier{1-7} without seeing any issues.
/Per
>
> Thanks,
> /Erik
More information about the hotspot-gc-dev
mailing list