RFR: 8261501: Shenandoah: reconsider heap statistics memory ordering

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8261501: Shenandoah: reconsider heap statistics memory ordering

Aleksey Shipilev-5
ShenandoahHeap collects heap-wide statistics (used, committed, etc). It does so by atomically updating them with default CASes. Unfortunately, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64.

This is excessive for statistics gathering, and "relaxed" should be just as good.

Additional testing:
 - [x] Linux x86_64 hotspot_gc_shenandoah
 - [x] Linux AArch64 hotspot_gc_shenandoah
 - [x] Linux AArch64 tier1 with Shenandoah

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

Commit messages:
 - 8261501: Shenandoah: reconsider heap statistics memory ordering

Changes: https://git.openjdk.java.net/jdk/pull/2504/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2504&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261501
  Stats: 9 lines in 1 file changed: 0 ins; 1 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2504.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2504/head:pull/2504

PR: https://git.openjdk.java.net/jdk/pull/2504
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261501: Shenandoah: reconsider heap statistics memory ordering

Aleksey Shipilev-5
On Wed, 10 Feb 2021 11:10:35 GMT, Aleksey Shipilev <[hidden email]> wrote:

> ShenandoahHeap collects heap-wide statistics (used, committed, etc). It does so by atomically updating them with default CASes. Unfortunately, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64.
>
> This is excessive for statistics gathering, and "relaxed" should be just as good.
>
> Additional testing:
>  - [x] Linux x86_64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 tier1 with Shenandoah

Friendly reminder.

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

PR: https://git.openjdk.java.net/jdk/pull/2504
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261501: Shenandoah: reconsider heap statistics memory ordering

Roman Kennke
In reply to this post by Aleksey Shipilev-5
On Wed, 10 Feb 2021 11:10:35 GMT, Aleksey Shipilev <[hidden email]> wrote:

> ShenandoahHeap collects heap-wide statistics (used, committed, etc). It does so by atomically updating them with default CASes. Unfortunately, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64.
>
> This is excessive for statistics gathering, and "relaxed" should be just as good.
>
> Additional testing:
>  - [x] Linux x86_64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 tier1 with Shenandoah

Looks good to me! Thanks!

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

Marked as reviewed by rkennke (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2504
Reply | Threaded
Open this post in threaded view
|

Integrated: 8261501: Shenandoah: reconsider heap statistics memory ordering

Aleksey Shipilev-5
In reply to this post by Aleksey Shipilev-5
On Wed, 10 Feb 2021 11:10:35 GMT, Aleksey Shipilev <[hidden email]> wrote:

> ShenandoahHeap collects heap-wide statistics (used, committed, etc). It does so by atomically updating them with default CASes. Unfortunately, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64.
>
> This is excessive for statistics gathering, and "relaxed" should be just as good.
>
> Additional testing:
>  - [x] Linux x86_64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 tier1 with Shenandoah

This pull request has now been integrated.

Changeset: 3f8819c6
Author:    Aleksey Shipilev <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/3f8819c6
Stats:     9 lines in 1 file changed: 0 ins; 1 del; 8 mod

8261501: Shenandoah: reconsider heap statistics memory ordering

Reviewed-by: rkennke

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

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