RFR: 8079315: UseCondCardMark broken in conjunction with CMS precleaning
aph at redhat.com
Tue May 5 15:18:51 UTC 2015
On 05/05/2015 04:02 PM, Vitaly Davidovich wrote:
> I realize this is a correctness fix, but isn't this going to possibly
> defeat any perf gain from using conditional card marking in the first place
> (for CMS)?
It shouldn't do. The idea of the UseCondCardMark AIUI is to reduce
thrashing of card table cache lines across cores. StoreLoad, while
possibly slow, should still be a local operation. So it all depends
on what we're trying to optimize: it's still the right thing to use
on a many-core machine, perhaps not for something smaller.
> Didn't someone suggest a different approach that allows
> store-store to be used still?
> For UseCondCardMark to be correct with CMS with precleaning it would
> require a StoreLoad between the field write and the card table load.
> Another approach to solve this partially would be to change the
> condition for the conditional card mark from an equality test aginst 0x0
> to a negated equality test of 0xff (clean_card_val)
> In that case we would slightly reduce the number of false-sharing
> inducing card writes and still survive the precleaning phase since
> precleaning sets the card to 0x1 (precleaned_card_val).
But I'm at a loss to understand how that helps with the problem of
reading an old value for the card mark. There still has to be some
sort of happens-before relationship between something and the read of
the card mark. What good would a store-store do here?
More information about the hotspot-gc-dev