RFR(XS): 8164038: Missing volatile keyword at CardTableRS::write_ref_field_gc_par()
sangheon.kim at oracle.com
Wed Mar 8 01:14:47 UTC 2017
Could I have some reviews for this tiny change that adds volatile qualifier?
Currently without 'volatile' we don't have any problem but I would like
to add it for the code readability.
Initially this problem occurred between b127 and b134 (<= b126 or >=
b135 are okay).
b127 includes "JDK-8155949, Support relaxed semantics in cmpxchg" and
b135 includes "JDK-8157904: Atomic::cmpxchg for jbyte is missing a fence
on initial failure".
The patch for JDK-8155949 changed 'jbyte Atomic::cmpxchg()' which
eventually affected not to reload the variable 'entry' at
CardTableRS::write_ref_field_gc_par(), so gc/cms/TestBubbleUpRef.java
failed on ARM machine. And the patch for JDK-8157904 fixed it.
But without the patch for JDK-8157904, just adding 'volatile' also fixes
After founding the root cause, I saw another CR, "JDK-8033552: Fix
missing missing volatile specifiers in CAS operations in GC code" also
includes adding 'volatile' from its initial patch so I closed this CR
but the final patch didn't include this part intentionally. After
discussing with the author of JDK-8033552, Erik Österlund, we decided to
fix under this CR.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev