RFR: Concurrent code cache evac should not update ptrs outside of safepoint
Aleksey Shipilev
shade at redhat.com
Sat Jul 1 07:54:47 UTC 2017
On 07/01/2017 09:39 AM, Andrew Haley wrote:
> 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?
Yes, embedded pointer oops, like these:
; {oop(a 'java/lang/Class'{0x00000005cac2d8c0} =
'org/openjdk/EmbeddedOops')}
0x00007f9e33539dc3: movabs $0x5cac2d8c0,%r10
0x00007f9e33539dcd: mov 0x14(%r10),%r11d
-Aleksey
More information about the shenandoah-dev
mailing list