RFR: 8310031: Parallel: Implement better work distribution for large object arrays in old gen [v24]

Albert Mingkun Yang ayang at openjdk.org
Thu Oct 19 16:04:31 UTC 2023


On Thu, 19 Oct 2023 14:07:21 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Richard Reingruber has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   preprocess_card_table_parallel should be private
>
> src/hotspot/share/gc/parallel/psCardTable.hpp line 49:
> 
>> 47:       // Old gen top is not card aligned.
>> 48:       size_t copy_length = align_up(stripe.byte_size(), _card_size) >> _card_shift;
>> 49:       size_t clear_length = align_down(stripe.byte_size(), _card_size) >> _card_shift;
> 
> Can you explain why `align_down` is needed here? I remember some reason why this needs to be the case at least for the old code, and @albertnetymk also explained it to me recently, but just now I can't figure it out (and it may not be required any more). Please add a comment, this is not obvious.

Since old-gen-top before scavenging might not be card-aligned, it's unsafe to clear it; hence the conservative (align-down) calculation. However, the right shift will do implicit align-down as well, so it is probably not needed. Better be explicit, I was thinking. Either is fine, I guess.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14846#discussion_r1365791289


More information about the hotspot-gc-dev mailing list