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

Richard Reingruber rrich at openjdk.org
Thu Oct 19 19:06:49 UTC 2023


On Thu, 19 Oct 2023 18:38:03 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> 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.
>
> 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.

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

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


More information about the hotspot-gc-dev mailing list