RFR: 8343658: Parallel: Implement block_start for Young generation

Volker Simonis simonis at openjdk.org
Thu Nov 7 12:40:43 UTC 2024


On Thu, 7 Nov 2024 10:48:25 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>>> this will not work in the general case, if the heap is not walkable.
>> 
>> True, but this is the best-effort approach used in other GCs, as far as I can tell. Is there a real use case that warrants a more sophisticated variant?
>
> What would be nice would be something like `oopDesc::safe_klass_or_null()` or similar, feeding into a corresponding `oopDesc::size_given_klass_safe_or_0()`. The former would check the klass word for validity before dereferencing - `CompressedKlassPointers::is_encodable(p)` and then the load of layouthelper etc should happen with SafeFetch. Alternatively (and a bit more unsafe), check the readability of Klass* with SafeFetch beforehand, then call normal size_given_klass.

> > this will not work in the general case, if the heap is not walkable.
> 
> True, but this is the best-effort approach used in other GCs, as far as I can tell. Is there a real use case that warrants a more sophisticated variant?

The **only** use case for this code during hs_err reporting for heap-addresses not pointing at the beginning of an oop. I think we should be conservative here, because a secondary crash will cut the information available in the hs_err file and will therefor do more harm then being helpful.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21919#discussion_r1832612499


More information about the hotspot-gc-dev mailing list