RFR(s): 8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
jon.masamitsu at oracle.com
Tue Mar 29 17:49:18 UTC 2016
I agree that we don't want to expose CardTableModRefBS::_last_valid_index
but I'd consider making CardTableModRefBS::cards_required() public.
That would remove the need to duplicate the calculation and it seems
a reasonable question to ask the card table implementation how many
cards it is going to require. I'll let other disagree if they like.
Add in the message a little more about why the value is too large.
397 "ParGCCardsPerStrideChunk (" INTX_FORMAT ") "is too large for the
heap size and " "must be "
398 "less than or equal to card table size (" SIZE_FORMAT ")\n",
399 value, card_table_size);
I think a little more information here would help future maintainers so
403 // If n_strides which is used with ParGCCardsPerStrideChunk is
really large, we would face an overflow.
This statement can overflow?
404 uintx n_strides = ParallelGCThreads * ParGCStridesPerThread;
On 3/28/2016 3:50 PM, sangheon wrote:
> Hi all,
> Could I have some reviews for this change?
> As very large value of ParGCCardsPerStrideChunk flag would result in
> an overflow, we need a constraint function after memory
> initialization. And the function will check the flag to be less than
> of equal to the size of card table and not to make an overflow with
> other stride factors(ParallelGCThreads and ParGCStridesPerThread).
> CR: https://bugs.openjdk.java.net/browse/JDK-8152176
> Webrev: http://cr.openjdk.java.net/~sangheki/8152176/webrev.00
> Testing: JPRT, all runtime/commandline JTREG tests on all platforms
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev