RFR: 8355627: Don't use ThreadCritical for EventLog list [v2]

Zhengyu Gu zgu at openjdk.org
Wed Apr 30 20:18:46 UTC 2025


On Wed, 30 Apr 2025 20:02:04 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Use LockFreeStack to link events on the eventLog queue.  They are never popped so this requires no further synchronization.
>> Tested by tier1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use CAS loop instead of lockFreeStack.

src/hotspot/share/utilities/events.cpp line 58:

> 56:     old_head = Atomic::load(&Events::_logs);
> 57:     _next = old_head;
> 58:   } while (Atomic::cmpxchg(&Events::_logs, old_head, this, memory_order_relaxed) != old_head);

I don't think it is safe to use `memory_order_relaxed` order if events are added after JVM enters multi-thread mode.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24954#discussion_r2069380710


More information about the hotspot-dev mailing list