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

Stefan Karlsson stefan.karlsson at oracle.com
Thu Aug 15 01:03:51 PDT 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20130815/07397e83/attachment.html 


More information about the hotspot-gc-dev mailing list