RFR: 8268052: [JVMCI] non-default installed code must be marked as in_use

Tom Rodriguez never at openjdk.java.net
Wed Jun 2 17:15:36 UTC 2021


On Wed, 2 Jun 2021 13:59:18 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> Ok.  I see the intent. In that case it seems like the reordering of the in_use and set_code calls was the important part of JDK-8226705.  It can't actually fail here since it hasn't been published until the following line, right?  Or is there some other way the nmethod is published?  Why couldn't the in_use state be set at the end of the nmethod factory method?
>
> I think it's published in the code cache and we had trouble with code walkers using only the CodeCache_lock to shoot down nmethods, but not the Compile_lock. If the walkers used the Compile_lock too then they wouldn't pick these up until they are fully installed. Plenty of room for improvements...

Yes, directly scanning the code cache seemed like the only other path.  It's unfortunate that the nmethod lifecycle seems to have gotten more complicated instead of less so.  So it could really fail in some exceptionally weird circumstances.

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

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


More information about the hotspot-compiler-dev mailing list