RFR(S): 8039042: G1: Phantom zeros in cardtable
Mikael Gerdin
mikael.gerdin at oracle.com
Tue May 13 12:41:32 UTC 2014
Per,
On Tuesday 13 May 2014 12.34.25 Per Liden wrote:
> 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/
The change looks good.
A fun bug to investigate indeed :)
I agree that setting of UseMemSetInBOT should be retired, we don't need a -XX:
+RandomlyCrashOnSolarisSparc flag.
/Mikael
>
> Thanks!
> /Per
More information about the hotspot-gc-dev
mailing list