RFR: 8325259: Serial: Inline OldGenScanClosure during Young GC [v2]
Stefan Karlsson
stefank at openjdk.org
Wed Feb 7 13:21:53 UTC 2024
On Tue, 6 Feb 2024 13:40:20 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Simple inlining oop closure during card-scanning of young-gc.
>>
>> Test: using the attached card-scanning-stressing benchmark, ~5x improvement (in terms of young-gc pause time) is observed on my box.
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>
> review
Changes requested by stefank (Reviewer).
src/hotspot/share/gc/serial/serialHeap.cpp line 159:
> 157:
> 158: old_gen()->process_old_to_young_refs();
> 159: }
The naming still needs some refinement. The word "process" is also a name that doesn't tell what operation it is performing. At the call to `process_roots` we pass in the provided closure, and that's the operation that is going to be applied. Whereas `process_old_to_young_refs` has the operation baked into the function, and should indicate what that operation is in the name.
This also shows that this functions becomes incoherent after this patch. One part operates on passed-in closures, while the second part uses a hard-coded closure. If you want to do this optimization, I think it would be better if you split `young_process_roots` into two separate functions. This will make it easier to follow what's going on in the code.
-------------
PR Review: https://git.openjdk.org/jdk/pull/17711#pullrequestreview-1867794591
PR Review Comment: https://git.openjdk.org/jdk/pull/17711#discussion_r1481463997
More information about the hotspot-gc-dev
mailing list