RFR: 8237842: Separate definitions for default cache line and padding sizes [v2]
Aleksey Shipilev
shade at openjdk.org
Wed Dec 6 19:37:35 UTC 2023
On Wed, 6 Dec 2023 18:36:23 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> If intention of original changes (add padding) was to avoid false sharing why we do it only for x64? From [JDK-8049737](https://bugs.openjdk.org/browse/JDK-8049737):
I don't understand the question. We add padding for all architectures to avoid false sharing. Avoiding false sharing _nominally_ requires padding by cache line size. That is why the default for `DEFAULT_PADDING_SIZE` is `DEFAULT_CACHE_LINE_SIZE`. x86 has (had?) a peculiarity with adjacent cache line hardware prefetchers that did require padding for *twice* the cache size to avoid false sharing in those unusual circumstances. I _guess_ SPARCv9 had the similar problem?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16973#issuecomment-1843566239
More information about the hotspot-dev
mailing list