[crac] RFR: Wait until G1 GC has finished before creating a snapshot. [v8]
Jan Kratochvil
jkratochvil at openjdk.org
Tue Aug 22 15:32:48 UTC 2023
On Thu, 27 Jul 2023 07:30:53 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> I have added there some assertions. Not sure they should stay this way, do you have more insight about it?
>
> Oh, I looked wrong, we're *not* calling it from VM operation (`VM_Crac::doit`). Asserting on the name of the thread makes no sense, that can be changed arbitrarily, and the checkpoint operation can be triggered from any thread, including a non-application thread if we use the `jcmd <pid> JDK.checkpoint`.
>
> I haven't checked all code paths but it seems that the `_instance` is set from `VM_G1CollectFull`. If we are to skip synchronization of access to `_instance` we could call the `wait_if_active` from our `VM_Crac` and use `assert(Thread::current()->is_VM_thread())` as the assertion. However when we're in another VM operation I guess the GC thread we would be waiting for isn't suspended in a safepoint (so we would deadlock).
It has been changed/simplified upon @AntonKozlov's comments so I find this discussion no longer relevant.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/93#discussion_r1301822338
More information about the crac-dev
mailing list