RFR(M): 8166970: Adapt mutex padding according to DEFAULT_CACHE_LINE_SIZE
thomas.stuefe at gmail.com
Fri Sep 30 16:28:17 UTC 2016
you do not have to do the subclassing just to find out the size of all
members preceding _name. Just use offsetof():
CACHE_LINE_PADDING = DEFAULT_CACHE_LINE_SIZE - offsetof(_name)
...Kind Regards, Thomas
On Fri, Sep 30, 2016 at 5:48 PM, Doerr, Martin <martin.doerr at sap.com> wrote:
> 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:
> Please review. If will also need a sponsor.
> Thanks and best regards,
More information about the hotspot-runtime-dev