RFR: 8323807: Async UL: Add a stalling mode to async UL [v2]

Johan Sjölen jsjolen at openjdk.org
Tue Apr 2 11:44:04 UTC 2024


On Tue, 2 Apr 2024 08:45:48 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/logging/circularStringBuffer.cpp line 94:
>> 
>>> 92: size_t CircularStringBuffer::used() {
>>> 93:   size_t h = Atomic::load(&head);
>>> 94:   size_t t = Atomic::load(&tail);
>> 
>> I assume these are `Atomic::load` because this code can be called without either the read lock or write lock? If so then the locked updates technically need to be `Atomic::store`.
>
> I'll change them to use `Atomic::store`, but shouldn't releasing the lock cause a full memory fence and therefore prevent the store from being delayed? Or is there something else that I'm missing?

To answer your question: Yes, this can be called without either lock being held. The goal is to have a cheaper variant of `await_message`. I renamed this to `maybe_has_message` to indicate that you must check whether a message exists when you take the consumer lock.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17757#discussion_r1547701329


More information about the hotspot-runtime-dev mailing list