RFR: 8265450: Merge PreservedMarksSet::restore code paths

Thomas Schatzl tschatzl at openjdk.java.net
Tue Apr 20 11:30:09 UTC 2021


On Tue, 20 Apr 2021 10:33:51 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I have reviews for this refactoring  that merges parallel and serial preserved marks restoration during evacuation failure into a single code path, simply by having the serial path call the parallel path in the VM thread.
>> 
>> This just reduces code and avoids the potential bugs when updating one path but not the other (which already happened).
>> 
>> The execution difference should not really matter for Serial GC where the serial path is executed:
>> - we are talking about the evacuation failure path
>> - there are likely a lot of preserved marks (random writes to the heap) that offset these two additional calls and some tiny superfluous member initialization.
>> 
>> Testing: tier1
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/shared/preservedMarks.cpp line 100:
> 
>> 98:   volatile size_t _total_size;
>> 99: #ifdef ASSERT
>> 100:   size_t _total_size_before;
> 
> I know `_total_size` is what was used before, but what do you think about changing it to `_total_count` now when we are touching it.

Should we rename `size` to `count` all the way through? Also `PreservedMarks` uses `size`, and that is where this comes from. There are likely other places where we use `size` instead of `count` (or `num`, depending on when the code has been written the first time).
Not sure this is the appropriate CR to do that, but not against it either.

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

PR: https://git.openjdk.java.net/jdk/pull/3584



More information about the hotspot-gc-dev mailing list