RFR: 8314850: SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter
Oli Gillespie
ogillespie at openjdk.org
Wed Aug 23 15:17:22 UTC 2023
On Wed, 23 Aug 2023 14:25:12 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> Please review the following fix. The check in SharedRuntime::reresolve_call_site() "caller.is_compiled_frame() && !caller.is_deoptimized_frame()" fails when caller is Continuation.enterSpecial because it is a native method. This means that if the static callsite to Continuation.enter was patched to point to an nmethod and then the nmethod was marked non-entrant we will always call SharedRuntime::handle_wrong_method() thereafter when resolving Continuation.enter because the callsite will never be reset back to the clean state. Thanks to @kuksenko for all the performance analysis while debugging this.
> I tested the patch by running the test included in the original report (loom-dev mailing list) and verifying the issue is fixed. I also run mach5 tiers1-3 for sanity testing and will run all the upper tiers too.
>
> Thanks,
> Patricio
Thanks! Indeed lowering `jdk.virtualThreadScheduler.parallelism` helps a lot and the improvement of the patch compared to before is quite clear at lower values. I'll be sure to test out the patch in my real workloads later.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15403#issuecomment-1690149138
More information about the hotspot-dev
mailing list