RFR: 8016538: volatile double access via Unsafe.cpp is not atomic

David Holmes david.holmes at oracle.com
Thu Jul 11 20:11:18 PDT 2013


Thanks Yumin this all looks good to me.

Of course we need to ensure the concurrency stress tests pass on all 
platforms.

David
-----

On 12/07/2013 5:17 AM, Yumin Qi wrote:
> Hi,  Vladimir and all
>
>    New webrev
> http://cr.openjdk.java.net/~minqi/8016538/03
> <http://cr.openjdk.java.net/%7Eminqi/8016538/03>
>
>    Changed for other x86 platforms too even they did not show the
> symptom, to keep codes as consistent for x86 arch.
>
>    Thanks
>    Yumin
>
> On 7/9/2013 3:11 PM, Yumin Qi wrote:
>> Vladimir,
>>
>> On 7/9/2013 2:16 PM, Vladimir Kozlov wrote:
>>> Hi Yumin,
>>>
>>> load_acquire() could be more expensive with this changes even for
>>> 64bit VM because you first loading from volatile address into local
>>> variable. Please, check what code is generated in 64-bit with your
>>> changes
>> I will check for that. Or we can guard by AMD64.
>>> Why you did not use release_store_fence() in
>>> OrderAccess::release_store_fence() and where is cast to jlong* ?
>>>
>> You  are right,  it is better with release_store_fence() on 64bit.
>> There is no functions for casting pointer I think.
>>
>> Thanks
>> Yumin
>>> Thanks,
>>> Vladimir
>>>
>>> On 7/9/13 11:32 AM, Yumin Qi wrote:
>>>> Hi,
>>>>
>>>>    Can i have your codereview of this change:
>>>>    Unsafe_Get[SET]DoubleVolatile are not atomic on 32bit x86 linux
>>>> caused test for
>>>> org.openjdk.concurrent.torture.tests.atomicity.primitives.reflect.DoubleAtomicityTest
>>>>
>>>> failed.
>>>>    The fix is using same treatment for jdouble as for jlong. Tests
>>>> passed on failed test case, vm quick tests. It only happens on linux
>>>> 32bit platform, on solaris, the inlined code be compiled into code of
>>>> using fldl/fstpl which are atomic instructions.
>>>>
>>>>    Contributed by: dholmes
>>>>
>>>>    URL: http://cr.openjdk.java.net/~minqi/8016538/01
>>>>
>>>>    Thanks
>>>>    Yumin
>>
>


More information about the hotspot-runtime-dev mailing list