RFR(M): 8166970: Adapt mutex padding according to DEFAULT_CACHE_LINE_SIZE
David Holmes
david.holmes at oracle.com
Thu Oct 6 02:30:46 UTC 2016
On 1/10/2016 1:48 AM, Doerr, Martin wrote:
> Hi,
>
> the current implementation of Monitor padding (mutex.cpp) assumes that cache lines are 64 Bytes. There's a platform dependent define "DEFAULT_CACHE_LINE_SIZE" available which can be used. Purpose of padding is to avoid false sharing.
>
> My proposed change is here:
> http://cr.openjdk.java.net/~mdoerr/8166970_mutex_padding/webrev.00/
Not sure I understand the existing padding code. What false sharing are
we trying to avoid?
And if the existing code assumes a cache line size of 64 and declares
_name to be 64 chars, then why can't the new code declare name to be
DEFAULT_CACHE_LINE_SIZE chars? This suggests the existing padding code
is wrong (not just hard-wired).
Which platforms will this cause an actual change in Monitor size other
than S390?
Thanks,
David
> Please review. If will also need a sponsor.
>
> Thanks and best regards,
> Martin
>
More information about the hotspot-runtime-dev
mailing list