RFR: 8305062: Refactor CardTable::resize_covered_region
Albert Mingkun Yang
ayang at openjdk.org
Mon Apr 17 14:34:36 UTC 2023
On Mon, 17 Apr 2023 13:42:24 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> keeping both _covered and _committed seems unnecessary; the latter can always be calculated from the former
True; I can try if the latter can be removed.
> Maybe some more specialization just for a serial/parallel gc card table would be nice as it's only used by them. In that sense, the initialize() method also seems to be specific to serial/parallel.
What specialization do you have in mind?
> src/hotspot/share/gc/shared/cardTable.cpp line 77:
>
>> 75: _byte_map_base(nullptr),
>> 76: _covered(MemRegion::create_array(_max_covered_regions, mtGC)),
>> 77: _committed(MemRegion::create_array(_max_covered_regions, mtGC)),
>
> Is it useful any more to dynamically create the `_committed` and `_covered` `MemRegions`? These are fixed size anyway. Also the code unconditionally allocates them even if not both are used. It seems to be a win to just statically allocate them.
`_covered` and `_committed` are also referenced in `vmStructs_gc.hpp`. I can use `MemRegion _covered[2];` inside `class CardTable`, but how to represent that array-type in `vmStructs_gc.hpp`?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13206#issuecomment-1511479387
PR Review Comment: https://git.openjdk.org/jdk/pull/13206#discussion_r1168805945
More information about the hotspot-gc-dev
mailing list