[crac] RFR: Wait until G1 GC has finished before creating a snapshot. [v6]

Anton Kozlov akozlov at openjdk.org
Mon Aug 7 12:38:11 UTC 2023


On Sun, 6 Aug 2023 12:49:36 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> I do not know much how all the threads and VM threads and GC pauses work but I disagree with this patch. The patch before was waiting until the asynchronous `G1UncommitRegionTask` has done its job. Currently we do the job ourselves but that means `G1UncommitRegionTask` can be executed asynchronously while we do the same job in our thread. And I do not see any `synchronized` keywords in the `uncommit_regions` code this patch calls now. So two threads doing the same job will clash.
>
> I read now I should contact https://mail.openjdk.org/pipermail/hotspot-gc-dev/ , thanks for the advice.

AFAICS HeapRegionManager::uncommit_inactive_regions is synchronized by Uncommit_lock.

https://github.com/openjdk/crac/blob/fbeaadb611f355b0616ebd25d86b9a7ced83276a/src/hotspot/share/gc/g1/heapRegionManager.cpp#L311

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

PR Review Comment: https://git.openjdk.org/crac/pull/93#discussion_r1285803562


More information about the crac-dev mailing list