[jdk17] RFR: 8270085: Suspend during block transition may deadlock if lock held [v2]

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Wed Jul 21 21:25:26 UTC 2021


On Wed, 21 Jul 2021 01:50:09 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> Hi all,
>> 
>> The following patch fixes deadlocks issues that could occur when checking for suspension while holding VM locks. See the bug description for a concrete case. The solution is to avoid checking for suspend requests when using the TBIVM wrapper. The original patch was actually written by @robehn(now on vacations) and I only made small changes.
>> 
>> Tested in mach5 tiers1-7. I also verified that the new added test SuspendBlocked.java deadlocks with the current bits and passes with this patch.
>> 
>> Thanks,
>> 
>> Patricio
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove /testlibrary from SuspendBlocked.java

While chatting with Coleen I realized the comment in should_process_no_suspend() wasn't accurate so I fixed it.  Not necessarily there will be a suspend request when reaching that path. The poll could be armed just because a safepoint or a non-suspend handshake operation was executed while the thread was safepoint safe.

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

PR: https://git.openjdk.java.net/jdk17/pull/257


More information about the hotspot-runtime-dev mailing list