United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6941395 G1: use only lock-free versions of region stack push() and pop()
JDK-6941395 : G1: use only lock-free versions of region stack push() and pop()

Details
Type:
Enhancement
Submit Date:
2010-04-06
Status:
Closed
Updated Date:
2011-04-23
Project Name:
JDK
Resolved Date:
2011-04-23
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs18
Fixed Versions:
hs20 (b02)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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
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.
                                     
2010-04-06
EVALUATION

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

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

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



Hardware and Software, Engineered to Work Together