RFR: 8275950: Use only _thread_in_vm in ~ThreadBlockInVMPreprocess() [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Mon Nov 1 14:21:10 UTC 2021


On Wed, 27 Oct 2021 14:28:48 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> Please review this small change. Since _thread_in_vm is already an unsafe state there is no need to use the intermediate _thread_blocked_trans state when transitioning back in ~ThreadBlockInVMPreprocess(). Tested tiers1-3 in mach5.
>> 
>> Thanks,
>> Patricio
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove assert in SS::block

Thumbs up! I have only a minor comment nit.

If I didn't know any better, I would think you're trying to remove the
whole concept of "transition" states. :-)

src/hotspot/share/runtime/interfaceSupport.inline.hpp line 232:

> 230:     assert(_thread->thread_state() == _thread_blocked, "coming from wrong thread state");
> 231:     // Change to transition state and ensure it is seen by the VM thread.
> 232:     _thread->set_thread_state_fence(_thread_in_vm);

The comment on L231 is now wrong since you're no longer using
a "transition" state. Perhaps, "Change to an unsafe state..."

src/hotspot/share/runtime/safepoint.cpp line 709:

> 707: 
> 708:   JavaThreadState state = thread->thread_state();
> 709:   assert(is_a_block_safe_state(state), "Illegal threadstate encountered: %d", state);

Getting rid of this assert makes me a bit nervous, but I have to
get used to the fact that @pchilano is making the safepointing
sub-system simpler and simpler...

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

Marked as reviewed by dcubed (Reviewer).

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


More information about the hotspot-runtime-dev mailing list