[master] RFR: Implement Shenandoah support [v23]
Roman Kennke
rkennke at openjdk.java.net
Wed Apr 20 15:05:01 UTC 2022
On Wed, 20 Apr 2022 14:35:42 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> is_forwarded() will always be good: 00 means stack-locked or inflating, 01 means unlocked, 10 means monitor and 11 means forwarded.
>> There are places where from-space header accesses (to get object size and/or Klass*) requires extra care: all those cases have been changed to use the new ShenandoahObjectUtils functions instead of the usual stuff, and this helper takes care of dealing with concurrent evacuation (i.e. the otherwise unexpected 11 state).
>
> Okay, let's consider following scenario:
> 1. worker 1 tries to evac obj, reads its header and it is not `marked`
> 2. worker 1 reads obj size and allocates to-space obj
> 3. worker 2 tried to evac the same obj, reads its header and it is still not `marked`
> 4. worker 2 tries to read obj size and temporary installs `INFLATING` mark word
> 5. worker 1 copies obj to to-space with `INFLATING` mark word (?)
> 6. worker 1 wins CAS, so to-space obj has `INFLATING' mark word?
At 6, worker 1 cannot win while the from-space object has INFLATING in its header. It will always try to CAS with the real original header. That is why we need the loop in the code that installs the forwarding pointer to retry when encountering INFLATING.
-------------
PR: https://git.openjdk.java.net/lilliput/pull/32
More information about the lilliput-dev
mailing list