RFR: 8315373: Change VirtualThread to unmount after freezing, re-mount before thawing

Alan Bateman alanb at openjdk.org
Thu Aug 31 19:32:06 UTC 2023


On Thu, 31 Aug 2023 17:31:34 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp line 415:
>> 
>>> 413:   } else {
>>> 414:     assert(NATIVE_SAMPLE == type, "invariant");
>>> 415:     if (thread_state_in_native(thread) && !is_vthread_in_transition(thread)) {
>> 
>> Is this possible? I assume the thread is in _thread_in_Java during the transition?
>
> There are some native methods that we execute during mount/unmount transitions. From what I see they all seem to be defined as `@IntrinsicCandidate`, but if for some reason we don't execute the intrinsic version (interp only mode for instance) then we would call a normal native method.

Just to ad that  Patricio suggested today to run the stress tests with -Xint and that does lead to triggered the assert quickly when the thread is sampled in native. There are several native methods that are @IntrinsicCandidate that are invoked after the thread identity has changed to the virtual thread and before the continuation is mounted. Probably less likely on the unmount as the only native method is the one that reverts the thread identity.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15492#discussion_r1312128046


More information about the serviceability-dev mailing list