RFR: 8334060: Implementation of Late Barrier Expansion for G1 [v2]
Martin Doerr
mdoerr at openjdk.org
Fri Aug 23 13:36:06 UTC 2024
On Mon, 19 Aug 2024 12:20:21 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
>> Note that we had such an optimization already in C2: https://github.com/openjdk/jdk8u-dev/blob/4106121e0ae42d644e45c6eab9037874110ed670/hotspot/src/share/vm/opto/library_call.cpp#L3114
>> But, it's probably not a big deal. Maybe I can try it on PPC64 which may be more sensitive to accesses on contended memory.
>
> Thanks for the reference, I would still prefer to keep this part as is for simplicity. We can always optimize the atomic barriers in follow-up work, if a need arises.
After thinking more about this, I figured out that we can optimize more when moving the pre_barrier after the cmpxchg. We can skip all G1 barriers if the cmpxchg fails:
https://github.com/TheRealMDoerr/jdk/blob/a48598075862f17e7b1cfbec29af4c2431809257/src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad#L171
This may reduce load on GC queue handling and related work for GC threads. I'm testing this version and I actually like it more than the version I had before. Please take a look.
(Note that my final version will need https://github.com/openjdk/jdk/pull/20689 to be integrated and merged into your PR.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19746#discussion_r1728987173
More information about the hotspot-compiler-dev
mailing list