RFR: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in compact GC

Kim Barrett kbarrett at openjdk.org
Tue Oct 1 16:42:35 UTC 2024


On Tue, 1 Oct 2024 13:22:52 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Please review this patch that adopts `PartialArrayState`introduced by [JDK-8337709](https://bugs.openjdk.org/browse/JDK-8337709) to consolidate `_oop_task_queues` and `_objarray_task_queues` into single `_marking_stacks`.
>> 
>> The change mirrors Kim's [JDK-8311163](https://bugs.openjdk.org/browse/JDK-8311163) work, therefore, there are methods can be consolidated and simplified, but I would like defer to a followup CR.
>
> src/hotspot/share/gc/parallel/psCompactionManager.hpp line 90:
> 
>> 88:   bool is_partial_array_state() const { return ((uintptr_t)_holder & PartialArrayStateBit) != 0; }
>> 89: };
>> 90: 
> 
> Please use `ScannerTask` instead; it seems to be completely serviceable for that purpose. In fact, a search&replace seems just fine.
> 
> https://github.com/openjdk/jdk/compare/pr/21089...tschatzl:jdk:pull/21089-recommendations?expand=1
> 
> I am going to experiment with refactoring the other duplicated (statistics) code

I ran into the same problem for G1 Full GC that @zhengyu123 has run into here.  ScannerTask deals in
_pointers_ to `oop` (and `narrowOop`).  For the separate marking cases we have `oop`s in the tasks.
I added a class just like this one in my work, except I put mine in gc/shared and gave it a different name
(OopScannerTask, which I don't love).  Clearly some coalescing is needed there.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21089#discussion_r1783181344


More information about the hotspot-gc-dev mailing list