RFR: Concurrent code cache evac should not update ptrs outside of safepoint
Aleksey Shipilev
shade at redhat.com
Fri Jun 30 12:55:12 UTC 2017
Turns out, I made the hell of the mistake by trying to update embedded code
cache ptrs during concurrent code cache evac. Updating code cache roots outside
safepoint is fine. Until it is not, when address you overwrite is not aligned.
Then you have the non-atomic store, and crash on a weird ptr, if application is
unlucky to be at that insn at that time. On x86, you need code cache ptr to span
cache lines.
The answer is to still evacuate code cache concurrently, but update the pointers
only at STW:
http://cr.openjdk.java.net/~shade/shenandoah/codecache-conc-evac-stwupdate/webrev.01/
This still has around 50% of the original pause improvement, and it moves the
code cache update pause from overloaded final-mark to less loaded
final-update-refs (when UR is active), further amortizing it.
Testing: hotspot_gc_shenandoah, failing tests
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list