RFR(two-liner): 8212707: GlobalCounter padding is too optimistic

Robbin Ehn robbin.ehn at oracle.com
Tue Oct 23 09:00:21 UTC 2018


Hi Martin,

On 10/22/18 4:05 PM, Doerr, Martin wrote:
> Hi Robbin,
> 
> thanks for fixing.

Thanks!

> 
> You could also use "DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile uintx));" as pre-padding if you want to minimize it.

Since there is only one instance, I'll skip that.
(In a non-integrated draft version of GlobalCounter the PaddedCounter was used 
in Thread also, therefore size did matter)

/Robbin

> 
> Best regards,
> Martin
> 
> 
> -----Original Message-----
> From: hotspot-runtime-dev <hotspot-runtime-dev-bounces at openjdk.java.net> On Behalf Of Robbin Ehn
> Sent: Montag, 22. Oktober 2018 13:15
> To: Claes Redestad <claes.redestad at oracle.com>; hotspot-runtime-dev at openjdk.java.net
> Subject: Re: RFR(two-liner): 8212707: GlobalCounter padding is too optimistic
> 
> Thanks Claes!
> 
> /Robbin
> 
> On 10/22/18 1:18 PM, Claes Redestad wrote:
>> Looks good to me, and as you imply in the comments the DEFAULT_CACHE_LINE_SIZE
>> should be 64 on x86_64
>>
>> /Claes
>>
>> On 2018-10-22 13:06, Robbin Ehn wrote:
>>> Hi all, please review.
>>>
>>> We should not divide DEFAULT_CACHE_LINE_SIZE by 2.
>>> More info in issue:
>>> https://bugs.openjdk.java.net/browse/JDK-8212707
>>>
>>> Code: below
>>>
>>> Sanity with T1.
>>>
>>> Thanks, Robbin
>>>
>>> diff -r bca2b63dd839 src/hotspot/share/utilities/globalCounter.hpp
>>> --- a/src/hotspot/share/utilities/globalCounter.hpp    Mon Oct 22 14:08:07
>>> 2018 +0800
>>> +++ b/src/hotspot/share/utilities/globalCounter.hpp    Mon Oct 22 11:48:17
>>> 2018 +0200
>>> @@ -48,1 +48,1 @@
>>> -    DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE/2, 0);
>>> +    DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0);
>>> @@ -50,1 +50,1 @@
>>> -    DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE/2, sizeof(volatile uintx));
>>> +    DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile uintx));
>>


More information about the hotspot-runtime-dev mailing list