RFR (S): 8023021: Unnecessary clearing of the card table introduced by the fix for JDK-8023013
Bengt Rutisson
bengt.rutisson at oracle.com
Thu Aug 15 08:04:45 UTC 2013
Thanks, Stefan!
Bengt
On 8/15/13 10:03 AM, Stefan Karlsson wrote:
> On 8/14/13 4:04 PM, Bengt Rutisson wrote:
>>
>> Hi all,
>>
>> Erik discovered a bug with the change for JDK-8023013 that I just
>> pushed. With my change we will do some unnecessary clearing of the
>> card table.
>>
>> Here's a webrev to fix that:
>> http://cr.openjdk.java.net/~brutisso/8023021/webrev.00/
>
> Looks good to me.
>
> StefanK
>>
>> Thanks Erik for finding this!
>>
>> From the bug report:
>>
>> The fix for JDK-8023013 "Use specific generations rather than
>> generation iteration" introduced unnecessary clearing of the card table.
>>
>> This loop (which existed both in CardTableRS::clear_into_younger()
>> and CardTableRS::invalidate_or_clear()):
>>
>> Generation* g = gen;
>> for(Generation* prev_gen = gch->prev_gen(g); prev_gen != NULL;
>> g = prev_gen, prev_gen = gch->prev_gen(g)) {
>> ...
>> }
>>
>> was translated in to one call for the old generation and one for the
>> young generation. But this is wrong. The loop is actually not a loop
>> when we only have two generations. These methods are only called with
>> gen being the old generation, so the translation should be to only do
>> one call to the old generation. No work should be done for the young
>> generation.
>>
>>
>> Thanks,
>> Bengt
>
>
More information about the hotspot-gc-dev
mailing list