RFR: 8337789: JEP 509: JFR CPU-Time Profiling (Experimental) [v47]
Zhengyu Gu
zgu at openjdk.org
Thu May 8 02:27:00 UTC 2025
On Thu, 8 May 2025 01:37:27 GMT, Andrei Pangin <apangin at openjdk.org> wrote:
>>> @zhengyu123 I don't see how a race you've described can happen. T2 will not reach `cmpxchg` to claim position 0, since an earlier check `if (state == state_empty(tail))` will fail in this case. Note that `state_empty(tail)` will be true for `tail == 1` but not for `tail == 3`. Or am I missing something?
>>
>> T1: can be scheduled out of CPU right after CAS, before ` Atomic::release_store(&e->_state, state_full(tail));`, so position 0 is still empty.
>
> Note that "is-empty" is not a binary flag in this algorithm. Empty state is assigned to a specific position of tail.
> Position 0 is marked empty for tail == 0, but not for tail == 2.
Ah, I missed generation encoding, my bad! sorry for the noise.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r2078781938
More information about the hotspot-dev
mailing list