RFR: 8271579: G1: Move copy before CAS in do_copy_to_survivor_space [v3]

Thomas Schatzl tschatzl at openjdk.java.net
Wed Aug 11 14:36:28 UTC 2021


On Fri, 6 Aug 2021 02:15:55 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Propose to move copy before CAS in do_copy_to_survivor_space, as we found this will improve G1 performance. Specjbb shows 3.7% in critical on aarch64, no change in max.
>> 
>> After this change copy_to_survivor in G1 is also aligned with PS's copy_to_survivor.
>
> Hamlin Li has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.

So we talked about this internally, and standalone it does not seem to be worth adding given that the gain you report is not reproducable on multiple (current) systems, and together we were not able to come up with an explanation why this suggested order of copy/cas would be better.

However it also enables further code improvements by simplifying (mark word) code. So we think that if this change and the mark word change suggested earlier together are at least performance-neutral (which is likely imo), we are going to take in both changes.

I'll start some perf runs with both changes applied (I'll just manually re-apply the mark word change you suggested earlier).

Hth,
  Thomas

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

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



More information about the hotspot-gc-dev mailing list