RFR(S): 8039042: G1: Phantom zeros in cardtable

Per Liden per.liden at oracle.com
Tue May 13 10:34:25 UTC 2014

Summary: We use memset to initialize the cardtable. On Sparc T4 (and 
later) memset uses some special instructions with the side-effect that 
the memory can temporarily be filled with zeros before the actual value 
is set. These phantom zeros can be observed by concurrent readers of 
this memory, which can trick the G1 post-barrier to incorrectly dirty a 
card in a young region. Please see the bug for a more details.

A similar memset-problem has been observed and fixed before 
(JDK-6948537) when using memset on the BlockOffsetTable. Similar to the 
BlockOffsetTable, I'm using the UseMemSetInBOT flag as an indicator of 
whether it's safe to use memset or not. UseMemSetInBOT is not a perfect 
name for this flag as code other than the BOT might want to use it. It's 
also questionable of this should be a command-line flag at all. I've 
filed a separate RFE, JDK-8042930, to do a bit of clean up related to 
this flag.

Bug: https://bugs.openjdk.java.net/browse/JDK-8039042
Webrev: http://cr.openjdk.java.net/~pliden/8039042/webrev.0/


More information about the hotspot-gc-dev mailing list