RFR: 8355627: Don't use ThreadCritical for EventLog list [v2]
Coleen Phillimore
coleenp at openjdk.org
Fri May 2 11:42:53 UTC 2025
On Fri, 2 May 2025 08:15:36 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> I saw no point in enforcing memory ordering mode here, as it looks like we only did `ThreadCritical` for mutual exclusion. Note that we do not have a matching acquire on list traversals, so seqcst/release on list additions would be incomplete. That only reinforces my original thinking: we are riding on memory ordering given by something else, I'd guess the initialization sequence itself.
>>
>> But I won't quibble, it is a very minor optimization.
>
> I guess we rely on memory ordering by address dependency on the reader's side.
Yes we only used ThreadCritical to add to the list after the VM becomes multithreaded. The list traversals (reads) are for hs_err_pid file printing, which presumably is single threaded at that point and presumably nothing is adding to the list. I added Atomic::load() but I think it's not necessary to be a load_acquire.
There are only about 10 items max on this list so far, so I think performance isn't a concern either way.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24954#discussion_r2071489248
More information about the hotspot-dev
mailing list