JDK-6941395 : G1: use only lock-free versions of region stack push() and pop()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs18
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-04-06
  • Updated: 2011-04-23
  • Resolved: 2011-04-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Related Reports
Relates :  
Relates :  
Description
In 6940310 we introduced versions of the push() and pop() methods on the CMRegionStack class that use locks to deal with failures that were caused by the MT-unsafe use of the lock-free push() and pop() versions (push() can be called concurrently, pop() can be called concurrently, but push() cannot be called concurrently with pop()). However, for performance and scalability reasons, it'd be good to go back to use the lock-free versions.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/4805b9f4779e
09-10-2010

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/4805b9f4779e
28-09-2010

EVALUATION See Description and Suggested Fix.
06-04-2010

SUGGESTED FIX The reason the failure with the lock-free versions happened was the fact that we broke the assumption that the pop() method was not supposed to be called concurrent with the push() method. If a marking thread pops a region, scans it and while it's scanning it notices that it should yield, it pushes the remainder of the region back on the stack. A possible way to re-instate the lock-free versions of push() / pop() is to avoid this push by storing the remainder of the region locally on the CMTask data structure and processing it next time the task restarts.
06-04-2010