RFR: 8373366: HandshakeState should disallow suspend ops for disabler threads [v3]

Serguei Spitsyn sspitsyn at openjdk.org
Tue Dec 16 11:20:07 UTC 2025


> An asynchronous handshake operation (`ThreadSelfSuspensionHandshakeClosure`) can be installed when the target thread is not in a `MountUnmountDisabler` scope. But the target thread can enter such scope by the time the operation is self-processed by the target thread.
> 
> This is fixed by a small tweak in the function
> `HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool check_async_exception)`.
> The tweak is to skip a `HandshakeOperation` if `_handshakee->is_vthread_transition_disabler() == true`, so the same temporary suspension disabling mechanism would be used as for `_handshakee->is_disable_suspend() == true`.
> 
> All other changes are to move the `is_vthread_transition_disabler()` out of DEBUG to product.
> 
> Testing:
>  - In progress: mach5 tiers 1-6

Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge
 - review: restored the assert and fixed the issue caused it to fire
 - 8373366: HandshakeState should disallow suspend ops for disabler threads

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28740/files
  - new: https://git.openjdk.org/jdk/pull/28740/files/b51267f3..2b088a62

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28740&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28740&range=01-02

  Stats: 35244 lines in 491 files changed: 23171 ins; 9295 del; 2778 mod
  Patch: https://git.openjdk.org/jdk/pull/28740.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28740/head:pull/28740

PR: https://git.openjdk.org/jdk/pull/28740


More information about the serviceability-dev mailing list