RFR: 8336299: Improve GCLocker stall diagnostics [v5]

Albert Mingkun Yang ayang at openjdk.org
Mon Aug 12 08:01:35 UTC 2024


On Fri, 9 Aug 2024 14:54:26 GMT, Neethu Prasad <nprasad at openjdk.org> wrote:

>> **Notes**
>> Adding logs to get more visibility into how fast a thread resumes from allocation stall. 
>> 
>> **Testing**
>> * tier 1, tier 2, hotspot_gc tests.
>> 
>> Example log messages
>> 
>> 1. Last thread exiting. Performing GC after exiting critical section. Thread "main" 0 locked.
>> 
>> 2. Thread exiting critical region Thread "main" 0 locked.
>> 
>> 3. Thread stalled by JNI critical section. Resumed after 586ms. Thread "Thread-0".
>> 
>> 4. Thread blocked to enter critical region. Resumed after 1240ms. Thread "SIGINT handler".
>
> Neethu Prasad has updated the pull request incrementally with one additional commit since the last revision:
> 
>   address code style feedback

src/hotspot/share/gc/shared/gcLocker.cpp line 139:

> 137:   // Wait for _needs_gc  to be cleared
> 138:   while (needs_gc()) {
> 139:     GCLockerTimingDebugLogger logger("Thread stalled by JNI critical section.");

If a spurious wakeup occurs, the logger will be instantiated multiple times, this can lead to confusing log msgs, right? If so, I wonder whether it makes sense to extract `logger` out of the while-iteration.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20277#discussion_r1713314902


More information about the hotspot-gc-dev mailing list