[jdk17] RFR: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX
Xin Liu
xliu at openjdk.java.net
Tue Jul 6 07:56:51 UTC 2021
On Tue, 6 Jul 2021 07:29:27 GMT, David Holmes <dholmes at openjdk.org> wrote:
> What we have to ensure in addition is that the number of outstanding log messages permitted by the buffer size is always less than the max value allow by the semaphore. Unfortunately we don't know what that value is.
On Linux, SEM_VALUE_MAX is defined in <semaphore.h>. we can add an assertion that `assert(_buffer_max_size < SEM_VALUE_MAX) `. Currently, it seems that hotspot needs to support 3 semaphores.
1. Posix semaphore of glibc. -- SEM_VALUE_MAX
2. Windows API -- LONG_MAX
3. MacOS -- I have found document for this.
Yes, you just unveil another issue. I found _buffer_max_size is 91k if I use `-XX:AsyncLogBufferSize=50M`. That value is bigger than SEM_VALUE_MAX of AIX.
`The maximum entries of AsyncLogBuffer: 91022`
-------------
PR: https://git.openjdk.java.net/jdk17/pull/216
More information about the hotspot-runtime-dev
mailing list