Re: Load reference barriers and safepoints

Liang Mao maoliang.ml at alibaba-inc.com
Tue Feb 27 03:14:02 UTC 2024


That's a good question and java thread won't throw any exceptions since evacuation failure is an internal
implementation detail which should not affect java behavior. As we know we cannot do immediately gc in a slow path call
when evacuation failure happens and we have to return from the LRB leaf call when evacuation failed(return the from space oop)
but there could be races that thread A returned a to-space oop in a successful evacuation and thread B returned a from-space oop
in a failed evacuation which broke to-space invariance. The solution is an evacuation failure protocol described in detail in 
shenandoahEvacOOMHandler.hpp. The root trick is that the java thread which encounters evacuation failure will block other evacuation
 to happen and wait for other successful evacuations to finish then resolve the oop.
Thanks,
Liang
------------------------------------------------------------------
From:Florian Weimer <fw at deneb.enyo.de>
Send Time:2024 Feb. 27 (Tue.) 03:47
To:"MAO, Liang" <maoliang.ml at alibaba-inc.com>
Cc:shenandoah-dev <shenandoah-dev at openjdk.java.net>
Subject:Re: Load reference barriers and safepoints
* Liang Mao:
> No. Load reference barriers don't have oopmap. And the slow path
> runtime call of LRB is a leaf call which doesn't have oopmap and
> cannot suspend in safepoint.
Thanks.
What happens on evacuation failure? Is that impossible for mutator
threads, or will the thread throw a pre-allocated exception?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/shenandoah-dev/attachments/20240227/a4cdc979/attachment.htm>


More information about the shenandoah-dev mailing list