RFR: 8260497: Shenandoah: Improve SATB flushing
Roman Kennke
rkennke at openjdk.java.net
Wed Jan 27 15:47:51 UTC 2021
Currently, we periodically force flushing of SATB queues. This works by activating a flag every 100ms in every thread, which causes that thread to enqueue its SATB buffer the next time it overflows, even if it doesn't meet its threshold after filtering. This is somewhat problematic when a thread does not actually overflow its SATB queue in time. The whole point of the exercise is to try and avoid having too much left-over work when we reach final-mark.
We can do better than that: when concurrent mark is done we can handshake all threads, and let them flush their respective SATB queues, and re-enter concurrent mark loop again, until flushing yields no more work. Experiments show that it usually takes 1-3 flushes to clean out leftover work properly.
I ran benchmarks, 3 high-pressure preset runs of SPECjbb2015, 10 minutes each:
baseline:
Finish Mark = 0,251 s (a = 688 us) (n = 364) (lvls, us = 125, 486, 621, 824, 4156)
Finish Mark = 0,338 s (a = 922 us) (n = 366) (lvls, us = 131, 494, 652, 852, 72948)
Finish Mark = 0,257 s (a = 699 us) (n = 368) (lvls, us = 111, 492, 645, 826, 4447)
patched:
Finish Mark = 0,112 s (a = 301 us) (n = 370) (lvls, us = 115, 207, 250, 281, 3709)
Finish Mark = 0,107 s (a = 292 us) (n = 368) (lvls, us = 107, 209, 248, 287, 3329)
Finish Mark = 0,114 s (a = 310 us) (n = 367) (lvls, us = 115, 211, 254, 285, 3819)
It reliably lowers all timings for finish-mark. It also doesn't cause any regressions in throughput.
Testing:
- [x] hotspot_gc_shenandoah
- [x] benchmarks
-------------
Commit messages:
- Some typing touch-ups
- Merge remote-tracking branch 'upstream/master' into conc-flush-satb
- Some cleanups, according to Aleksey's suggestions
- Use SATBMarkQueue's enqueued counter; Aleksey's comments
- Remove some more unrelated changes
- Remove unrelated changes
- Merge branch 'master' into conc-flush-satb
- Remove old force-flush impl; retry until no more SATB enqueues
- Simpler flushing
- Merge branch 'master' into conc-flush-satb
- ... and 2 more: https://git.openjdk.java.net/jdk/compare/7ed591cc...8df11fc1
Changes: https://git.openjdk.java.net/jdk/pull/2254/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2254&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8260497
Stats: 94 lines in 10 files changed: 30 ins; 59 del; 5 mod
Patch: https://git.openjdk.java.net/jdk/pull/2254.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2254/head:pull/2254
PR: https://git.openjdk.java.net/jdk/pull/2254
More information about the shenandoah-dev
mailing list