RFR: 8293922: Extend barrier-less Java thread transitions to native transitions [v2]

Robbin Ehn rehn at openjdk.org
Mon Sep 19 05:51:09 UTC 2022


On Fri, 16 Sep 2022 12:24:45 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> As suggested by @TheRealMDoerr, avoid the fence for native trans when UseSystemMemoryBarrier is enabled.
>> 
>> Locally I can see methods like Thread.holdsLock() getting a 4 ns speed boost, (~20% faster).
>> 
>> Running t1-5 with UseSystemMemoryBarrier on.
>
> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use proper accessors for _thread_state

The casts came from the time when the atomics didn't use templates, so it only supported integer types.

TBIVM should not really notice any difference, since it mostly used together with VM Mutex, thus must emit a fence on front edge. As Dan says, do a separate RFE if you like it to be consistent.

Thanks for reviewing!

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

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


More information about the hotspot-runtime-dev mailing list