RFR: 8323807: Async UL: Add a stalling mode to async UL [v10]
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Jan 23 10:35:51 UTC 2025
On Thu, 23 Jan 2025 08:37:18 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/share/logging/logAsyncWriter.cpp line 105:
>>
>>> 103: if (LogConfiguration::async_mode() == LogConfiguration::AsyncMode::Stall) {
>>> 104: size_t size = Message::calc_size(msg_len);
>>> 105: void* ptr = os::malloc(size, mtLogging);
>>
>> Your mention of recursion made me check if we are logging from our `os:malloc/free` calls. I can find at least one path do `log_warning` in debug builds. This will cause both recursive locking on our PlatformMonitor and cause infinite recursion if the second message does not fit in the buffer.
>>
>> Maybe this logging is unreachable from this specific context. But I find it a little scary nonetheless. Maybe this should be documented somewhere.
>
> Hi Axel,
>
> I've already switched to having the consumer thread log anything it itself logs directly without going through the buffer so this won't be an issue. See `enqueue_if_locked` (I'll be removing that and only have `enqueue` soon, however, so check there if you can't find it).
Not sure I understand what you are trying to say. Maybe it will be clearer when you have pushed code.
But I am not talking about the consumer. I am talking about any thread which logs and calls into here, then fails to write to the buffer, and calls `os::malloc` which in turn may log, which calls back into this code. But maybe you are saying there are already guardrails around logging under the ProducerLock.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22770#discussion_r1926746176
More information about the hotspot-runtime-dev
mailing list