[jdk17] RFR: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX

David Holmes david.holmes at oracle.com
Tue Jul 13 01:16:46 UTC 2021


On 9/07/2021 11:33 am, Xin Liu wrote:
> On Thu, 8 Jul 2021 09:43:11 GMT, David Holmes <david.holmes at oracle.com> wrote:
> 
>> One possibility is to change the code to use a Monitor that acts as the
> asynclog lock and the wakeup mechanism, with a suitable guard in the
> writing code so that we don't try to use the Monitor until after it has
> been initialised (which is after the first log writes may occur).
> 
> I am not sure about that. The current code derived from there. HotSpot Monitor needs Thread::current(), but the logging event spans from the very beginning to the very end of JVM. We have to circumvent those cases.

But we already circumvent that for async logging. We can't use async 
logging until after we have called AsyncLogWriter::initialize(). So the 
synchronization objects used by AsyncLogWriter can be plain 
Mutex/Monitor, they don't need to be Semaphore.

> On the other hand, I carefully read the implementation of semaphore_signal on Darwin. I am pretty sure it returns KERN_SUCCESS when overflow happens. I added a line of comment in the last revision. Could you take a look at that?

The issue is not what it returns but how it actually behaves.

David
-----

> -------------
> 
> PR: https://git.openjdk.java.net/jdk17/pull/216
> 


More information about the hotspot-runtime-dev mailing list