RFR: 8258015: [JVMCI] JVMCI_lock shouldn't be held while initializing box classes
Igor Veresov
iveresov at openjdk.java.net
Thu Dec 10 09:03:39 UTC 2020
On Thu, 10 Dec 2020 06:29:46 GMT, Jie Fu <jiefu at openjdk.org> wrote:
> Hi all,
>
> Plenty of AOT tests failed after JDK-8257917.
> The reason is that JVMCI_lock [1] was held during box classes initilization.
> However, this assert [2] doesn't allow a lock (except tty_lock [3]) to be held in that case.
> So JVMCI_lock here [1] should be removed.
>
> Testing:
> compiler/aot and compiler/jvmci on Linux/x64
>
> Thanks.
> Best regards,
> Jie
>
>
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/jvmci/jvmci.cpp#L133
> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/thread.cpp#L795
> [3] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/mutex.cpp#L440
Yes, seems like, we can safely get rid of this lock since the init state change in InstanceKlass is already under a lock. Worst case scenario we do that loop a few times. @dougxc, what do you think?
Alternatively, we can drop the checks of the initialized flag for AOT entirely.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1727
More information about the hotspot-compiler-dev
mailing list