RFR: 8335269: [Graal] occasional timeout in java/lang/StringBuffer/TestSynchronization.java with loom [v3]

Patricio Chilano Mateo pchilanomate at openjdk.org
Tue Jul 9 16:38:13 UTC 2024


> Please review the following simple fix. A pinned virtual thread calling Thread.yield() in a loop might never poll for safepoints if the compiler relies on a poll in native method Continuation.doYield while optimizing. This is a special native method that doesn't always poll for safepoints, and in particular it doesn't if the virtual thread is pinned due to owning monitors. Currently this scenario can be reproduced with the Graal compiler.
> 
> I included a test which reproduces the issue with Graal (couldn't reproduce the issue with c2). The test times out without the fix and passes with it. I also run the patch through mach5 tiers1-3.
> 
> Thanks,
> Patricio

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  Rename test to ThreadPollOnYield.java

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20016/files
  - new: https://git.openjdk.org/jdk/pull/20016/files/ce777598..79be1fcc

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

  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/20016.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20016/head:pull/20016

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


More information about the hotspot-dev mailing list