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

Richard Reingruber rrich at openjdk.org
Thu Oct 19 20:10:12 UTC 2023


On Thu, 19 Oct 2023 19:04:23 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> The highest value `byte_size()` can have is old_gen-end - old_gen_bottom (both card-aligned; one stripe, one slice), which is the exact length needed when covering all cards.
>> Any top value != end must have a committed corresponding card table entry, otherwise marking the card that contains `top` would crash. Also the copying would fail then, reading from uncommitted areas beyond the card table. The code does not do that afaics.
>> 
>> So the only problematic one I can see would be clearing the card exactly starting at old_gen-end, which an `align_up()` wouldn't do either.
>> 
>> So I do not completely get why clearing the card containing top would be unsafe. Can you give an example?
>
> Likely I do not completely understand what you are saying but this would be my explanation why the `align_down` for `clear_length` is needed.
> `T := old_gen->object_space()->top()` is not necessarily card aligned at scavenge start. We must not clear the card for `T` if an object was copied there because it was promoted and it has a reference to a young object on that card.

Example

We cannot clear card n containing old gen top T because we won't scan the promoted
objects on card n and we can only clear cards if we scan all objects on them afterwards.


  card n-1             card n               card n+1
 +--------------------+--------------------+--------------------
 |                    |        .  Promoted |
 |                    |        .  Objects  |
 |                    |        .           |
 +--------------------+--------------------+--------------------
                               ^
                               |
                               T
                      old gen top at scavenge start
                    / end of last stripe

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

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


More information about the hotspot-gc-dev mailing list