United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7080389 G1: refactor marking code in evacuation pause copy closures
7080389 : G1: refactor marking code in evacuation pause copy closures

Details
Type:
Enhancement
Submit Date:
2011-08-17
Status:
Closed
Updated Date:
2011-10-07
Project Name:
JDK
Resolved Date:
2011-09-30
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs22
Fixed Versions:
hs22

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
As part of 6484965, the following behavior was observed:

During root scanning of an initial mark pause, an object A is successfully forwarded by thread 1; thread 1 then proceeded to copy A to A'.

At the same time thread 2 sees that A has been forwarded, checks to see if A' has been marked (it has not yet), and successfully sets the bit for A' in the next marking bitmap.

After thread 1 has finished copying object A -> A', it calls mark_forwardee which checks to see if A' has been marked and it has.

The issue is that while thread 1 is copying A -> A', there is a window where if thread 2 attempts to get the size of A', it could see an unitialized object.

This has an implication for the preferred solution for 6484965. In the preferred solution, when an object is marked, we obtain its size in order to add to the marked bytes total.

The solution is to refactor the marking code in the G1 copy closures so that the thread that successfully for forwards and copies A is also responsible for marking A'.

                                    

Comments
EVALUATION

See main CR
                                     
2011-09-14
SUGGESTED FIX

Push the mark_forwardee() calls from G1ParCopyClosure::do_oop_nv into G1ParCopyClosure::do_oop_work and G1ParCopyHelper::copy_to_survivor_space. Execute the code in copy_to_survivor_space that marks the copied object if the current closure is a root scan/mark closure, we're during an initial mark pause, or (we're during marking itself and) the old object has a mark that needs to be propagated to the new object.

Try to use the template parameter (do_mark_forwardee) wherever possible to avoid additional runtime per object checks.
                                     
2011-08-29
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/eeae91c9baba
                                     
2011-08-29
EVALUATION

Multiple threads attempt to mark the same forwarded object during an initial mark evacuation pause. Refactor code so that the thread which is successful in forwarding and copying an object will also mark the forwarded object.
                                     
2011-08-17



Hardware and Software, Engineered to Work Together