RFR (S): JDK-8172434: CompareAndExchangeObject inserts two pre-barriers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR (S): JDK-8172434: CompareAndExchangeObject inserts two pre-barriers

Roman Kennke-6
in LibaryCallKit::inline_unsafe_access(), the pre_barrier() gets
inserted twice for LS_cmp_exchange, in one case it is treated like the
other CAS instructions, and at the end it is treated like get_and_set.
It's not causing incorrect behaviour, but might impact performance.

The fix is to leave out the 2nd pre-barrier for CAE by checking for
get_and_set.

Testing: jcstress

http://cr.openjdk.java.net/~rkennke/fix-cae-prebarrier/webrev.01/

Roman
Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): JDK-8172434: CompareAndExchangeObject inserts two pre-barriers

Vladimir Kozlov
Looks good.

Thanks,
Vladimir

On 2/13/17 1:11 PM, Roman Kennke wrote:

> in LibaryCallKit::inline_unsafe_access(), the pre_barrier() gets
> inserted twice for LS_cmp_exchange, in one case it is treated like the
> other CAS instructions, and at the end it is treated like get_and_set.
> It's not causing incorrect behaviour, but might impact performance.
>
> The fix is to leave out the 2nd pre-barrier for CAE by checking for
> get_and_set.
>
> Testing: jcstress
>
> http://cr.openjdk.java.net/~rkennke/fix-cae-prebarrier/webrev.01/
>
> Roman
>
Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): JDK-8172434: CompareAndExchangeObject inserts two pre-barriers

Roman Kennke-6
Hi Vladimir,

thanks!

I think I need a sponsor now? Can you do that?

Thanks,
Roman


Am Montag, den 13.02.2017, 16:41 -0800 schrieb Vladimir Kozlov:

> Looks good.
>
> Thanks,
> Vladimir
>
> On 2/13/17 1:11 PM, Roman Kennke wrote:
> > in LibaryCallKit::inline_unsafe_access(), the pre_barrier() gets
> > inserted twice for LS_cmp_exchange, in one case it is treated like
> > the
> > other CAS instructions, and at the end it is treated like
> > get_and_set.
> > It's not causing incorrect behaviour, but might impact performance.
> >
> > The fix is to leave out the 2nd pre-barrier for CAE by checking for
> > get_and_set.
> >
> > Testing: jcstress
> >
> > http://cr.openjdk.java.net/~rkennke/fix-cae-prebarrier/webrev.01/
> >
> > Roman
> >
Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): JDK-8172434: CompareAndExchangeObject inserts two pre-barriers

Vladimir Ivanov
Looks good.

I'll sponsor the fix.

Best regards,
Vladimir Ivanov

On 2/14/17 12:46 PM, Roman Kennke wrote:

> Hi Vladimir,
>
> thanks!
>
> I think I need a sponsor now? Can you do that?
>
> Thanks,
> Roman
>
>
> Am Montag, den 13.02.2017, 16:41 -0800 schrieb Vladimir Kozlov:
>> Looks good.
>>
>> Thanks,
>> Vladimir
>>
>> On 2/13/17 1:11 PM, Roman Kennke wrote:
>>> in LibaryCallKit::inline_unsafe_access(), the pre_barrier() gets
>>> inserted twice for LS_cmp_exchange, in one case it is treated like
>>> the
>>> other CAS instructions, and at the end it is treated like
>>> get_and_set.
>>> It's not causing incorrect behaviour, but might impact performance.
>>>
>>> The fix is to leave out the 2nd pre-barrier for CAE by checking for
>>> get_and_set.
>>>
>>> Testing: jcstress
>>>
>>> http://cr.openjdk.java.net/~rkennke/fix-cae-prebarrier/webrev.01/
>>>
>>> Roman
>>>