RFR (S): 8023021: Unnecessary clearing of the card table introduced by the fix for JDK-8023013

Bengt Rutisson bengt.rutisson at oracle.com
Wed Aug 14 07:04:20 PDT 2013


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/

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20130814/f1ec704f/attachment-0001.html 


More information about the hotspot-gc-dev mailing list