[jdk17] RFR: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX [v3]
Xin Liu
xliu at openjdk.java.net
Tue Jul 6 22:09:13 UTC 2021
> This patch solved the sempahore overflow issue with errno ERANGE or EOVERFLOW.
> Previously, we have asymmetric p/v operations for semaphore _sem. Each iteration
> only decrements _sem 1 but dequeues N messages. If logging threads keep preempting
> async logging thread, it may cause the value of _sem accumulates until overflow!
>
> The patch corrects the value of _sem after write(). n messages are dequeued/processed.
> We need to invoke _sem.wait() max(n-1, 1) time. This ensures that each iteration
> decrements n instead of 1.
Xin Liu has updated the pull request incrementally with three additional commits since the last revision:
- Ignore sem_post failure when _sem of AsyncLogWriter is overflown.
- Revert "8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX"
This reverts commit 269a1580990fa955c1f9d37ce1d04a6349959992.
- Revert "Fix build issue on Windows and simplify the loop."
This reverts commit e385f42fa4e03510242039518281077e3c9897cf.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk17/pull/216/files
- new: https://git.openjdk.java.net/jdk17/pull/216/files/e385f42f..10bfce91
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=216&range=02
- incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=216&range=01-02
Stats: 40 lines in 8 files changed: 19 ins; 9 del; 12 mod
Patch: https://git.openjdk.java.net/jdk17/pull/216.diff
Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/216/head:pull/216
PR: https://git.openjdk.java.net/jdk17/pull/216
More information about the hotspot-runtime-dev
mailing list