RFR: 8336299: Improve GCLocker stall diagnostics [v6]

Albert Mingkun Yang ayang at openjdk.org
Tue Aug 13 06:37:51 UTC 2024


On Mon, 12 Aug 2024 22:39:25 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 feedback regarding logger potentially getting instantiated multiple times

> 2. Thread exiting critical region Thread "main" 0 locked.

Seems that there is period missing after "region" in the PR description. (The code looks correct to me.)

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

> 56:       ResourceMark rm; // JavaThread::name() allocates to convert to UTF8
> 57:       const Tickspan elapsed_time = Ticks::now() - _start;
> 58:       log.debug("%s Resumed after " UINT64_FORMAT "ms. Thread \"%s\".", _log_message, elapsed_time.milliseconds(), Thread::current()->name());

Maybe `UINT64_FORMAT` can be replaced by `%zu`?

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

PR Review: https://git.openjdk.org/jdk/pull/20277#pullrequestreview-2234616989
PR Review Comment: https://git.openjdk.org/jdk/pull/20277#discussion_r1714739408


More information about the hotspot-gc-dev mailing list