RFR: Concurrent code cache evac should not update ptrs outside of safepoint

Andrew Haley aph at redhat.com
Sat Jul 1 07:39:23 UTC 2017


On 30/06/17 13:55, Aleksey Shipilev wrote:

> 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:

On some processors it's illegal to change code while it is executing.
Or rather, it is undefined what happens if you do.  Are these embedded
pointers OOPs, or something else?

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the shenandoah-dev mailing list