RFR (S) 8078438: Interpreter should support conditional card marks (UseCondCardMark)

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Apr 27 22:19:54 UTC 2015


Hi Kim,

On 28.04.2015 01:05, Kim Barrett wrote:
> The G1 post-barrier always checks the old card value before storing
> the dirty value, without conditionalization on UseCondCardMark.  The
> x86 G1 post-barrier also precedes the load of the old card value with a
> StoreLoad membar, which is not present in the proposed change.
> 
> That barrier was added by the fix for:
> 8014555: G1: Memory ordering problem with Conc refinement and card marking
> 
> I suspect that issue doesn't apply to non-concurrent collectors.  I
> don't know whether it would matter for non-G1 concurrent collectors like
> CMS though.

I would expect it does not matter for non-concurrent collectors, since
card table updates should be seen by collector after the mutator stops,
like all other regular updates in the heap.

It would be interesting to see if CMS really requires the barrier,
because if so, C1 and C2 UseCondCardMark code is already broken for CMS.
I would think that if cards can be moved from "dirty" to "clean" state
when mutator runs concurrently, then you would need a memory barrier in
mutator's write barrier code, otherwise you can lose the card update...

Thanks,
-Aleksey.




More information about the hotspot-runtime-dev mailing list