RFR: 8317433: Async UL: Only grab lock once when write():ing [v3]

David Holmes dholmes at openjdk.org
Fri Oct 6 06:25:11 UTC 2023


On Thu, 5 Oct 2023 10:20:02 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> The writer thread used to await for `_data_available` to become true through using the async log lock as a condition variable. When data is available it'd let go of the lock and then call `AsyncLogWriter::write()`, which would immediately try to acquire that same lock. We can remove this second instance by moving the work needed to be done under lock to `run`.
>> 
>> Thank you for considering this.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rewrite comment

src/hotspot/share/logging/logAsyncWriter.cpp line 139:

> 137:       stringStream ss;
> 138:       ss.print(UINT32_FORMAT_W(6) " messages dropped due to async logging", counter);
> 139:       output->write_blocking(decorations, ss.freeze());

Just to check but are we guaranteed that the ss content will be copied eventually?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16030#discussion_r1348288057


More information about the hotspot-runtime-dev mailing list