RFR: 8355608: Async UL should take the file lock of stream when outputting

Axel Boldt-Christmas aboldtch at openjdk.org
Mon Apr 28 12:27:46 UTC 2025


On Fri, 25 Apr 2025 13:01:44 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> With the introduction of [JDK-8349755](https://bugs.openjdk.org/browse/JDK-8349755), it is not entirely clear any longer that the Async UL has exclusive access to the files which are being logged to in the JVM. We should take the file lock for the stream being logged to for safety's sake.
> 
> If, for example, an unattached thread logs, then it will do so without the help of the Async UL thread.
> 
> This is expected to very rarely, if ever, happen. Since taking an uncontested mutex is very cheap, I expect this to have a negligible performance impact.
> 
> Testing: GHA, tier1
> 
> Cheers,
> Johan

lgtm.

Not sure if we have a good way to test UL logging performance, but might be worth running some benchmarks with logging enabled to verify the expectation.

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

Marked as reviewed by aboldtch (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24874#pullrequestreview-2799114089


More information about the hotspot-runtime-dev mailing list