Integrated: 8261493: Shenandoah: reconsider bitmap access memory ordering
Aleksey Shipilev
shade at openjdk.java.net
Mon Feb 15 08:47:44 UTC 2021
On Wed, 10 Feb 2021 09:32:18 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Shenandoah currently uses its own marking bitmap (added by JDK-8254315). It accesses the marking bitmap with "acquire" for reads and "conservative" for updates. 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.
>
> I think both are actually excessive for marking bitmap accesses: we do not piggyback object updates on it, the atomics there are only to guarantee the access atomicity and CAS updates to bits. It seems "relaxed" is enough for marking bitmap accesses.
>
> Sample run with "compact" (frequent GC cycles) on SPECjvm2008:compiler.sunflow on AArch64:
>
> # Baseline
> # Baseline
> [146.028s][info][gc,stats] Concurrent Marking = 50.315 s (a = 258024 us) (n = 195) (lvls, us = 31836, 230469, 273438, 306641, 464255)
> [141.458s][info][gc,stats] Concurrent Marking = 47.819 s (a = 242737 us) (n = 197) (lvls, us = 42773, 197266, 267578, 287109, 433948)
> [144.108s][info][gc,stats] Concurrent Marking = 49.806 s (a = 250283 us) (n = 199) (lvls, us = 32227, 201172, 267578, 296875, 448549)
>
> # Patched
> [144.238s][info][gc,stats] Concurrent Marking = 46.627 s (a = 220981 us) (n = 211) (lvls, us = 24414, 197266, 238281, 259766, 345112)
> [138.406s][info][gc,stats] Concurrent Marking = 45.022 s (a = 227383 us) (n = 198) (lvls, us = 20508, 205078, 244141, 271484, 427658)
> [140.950s][info][gc,stats] Concurrent Marking = 45.073 s (a = 222036 us) (n = 203) (lvls, us = 21680, 181641, 240234, 265625, 375750)
>
> Average time goes down, total marking time goes down.
>
> 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: 745c0b91
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/745c0b91
Stats: 18 lines in 2 files changed: 0 ins; 14 del; 4 mod
8261493: Shenandoah: reconsider bitmap access memory ordering
Reviewed-by: rkennke, zgu
-------------
PR: https://git.openjdk.java.net/jdk/pull/2497
More information about the hotspot-gc-dev
mailing list