RFR (XS): 8033922: G1: Back out 8033601 and go back to use the to-obj for chunked arrays.

Bengt Rutisson bengt.rutisson at oracle.com
Fri Feb 7 05:23:31 PST 2014


Hi Stefan,

Thanks for the quick review!

Bengt

On 2/7/14 1:38 PM, Stefan Karlsson wrote:
>
> On 2014-02-07 13:29, Bengt Rutisson wrote:
>>
>> Hi all,
>>
>> Can I have a couple of reviews for backing out the changes for 
>> 8033601. Those changes cause verification failures in our nightly 
>> testing.
>>
>> http://cr.openjdk.java.net/~brutisso/8033922/webrev.00/
>
> OK.
>
> StefanK
>
>>
>> https://bugs.openjdk.java.net/browse/JDK-8033922
>>
>> Background from the CR:
>>
>> The fix for 8033601 changed the code for chunked arrays to use the 
>> from obj length as index rather than the to object.
>>
>> This was nice since it made G1 look more like the other collectors.
>>
>> However, another difference in G1 is that it writes the forward 
>> pointer before it writes the to-object. That means that there are 
>> times when an object is forwarded, but there is no to-object image 
>> that can be trusted.
>>
>> One such place is
>>
>> void G1ParCopyClosure<barrier, do_mark_object>
>> ::do_oop_work(T* p)
>>
>> We can find that the object is forwarded, but it may not have been 
>> marked yet. So, we end up calling mark_forwarded_object() which needs 
>> the size to call _cm->grayRoot(to_obj, (size_t) from_obj->size(), 
>> _worker_id);
>>
>> mark_forwarded_object() has a comment that tries to describe this 
>> situation:
>>
>>   // The object might be in the process of being copied by another
>>   // worker so we cannot trust that its to-space image is
>>   // well-formed. So we have to read its size from its from-space
>>   // image which we know should not be changing.
>>   _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);
>>
>> So, just as the comment say, we can not trust the to-space image. 
>> However, after the change for 8033601 we can not trust the from-space 
>> image either.
>>
>> This seems like a show-stopper for the suggested change for 8033601 
>> so we need to back it out.
>>
>> Thanks,
>> Bengt
>



More information about the hotspot-gc-dev mailing list