RFR: 8302760: Improve liveness/remembered set verification for G1 [v2]

Kim Barrett kbarrett at openjdk.org
Wed Feb 22 10:19:24 UTC 2023


On Wed, 22 Feb 2023 09:40:52 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/heapRegion.cpp line 517:
>> 
>>> 515:       LogStream ls(log.error());
>>> 516: 
>>> 517:       MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag);
>> 
>> [pre-existing] It's not clear to me what this lock is protecting.  Similarly for the one in `verify_remset`
>> (in an unmodified part of it).
>
> Having this lock avoids the log messages for a single failures (these are multiple lines each) to mix. Having log messages that are mashed together makes it hard/impossible to analyze the failures. Does that make sense?

Oh, you are right. For some reason I thought LogStream did that, but
apparently I misremembered. Some documentation for LogStream &etc would be
helpful.

One can avoid the interleaving by using LogMessage and
NonInterleavingLogStream, though that might end up generating more allocations
than a LogStream with the surrounding lock.

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

PR: https://git.openjdk.org/jdk/pull/12660


More information about the hotspot-gc-dev mailing list