RFR: 8237842: Separate definitions for default cache line and padding sizes

Sandhya Viswanathan sviswanathan at openjdk.org
Wed Dec 6 23:07:37 UTC 2023


On Wed, 6 Dec 2023 09:58:42 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> Sure. It think it is a good patch. However, given that you added this commment:
> 
> ```
> // Hardware prefetchers on current implementations may pull 2 cache lines
> // on access, therefore we pessimistically assume twice the cache line size
> // for padding.
> ```
> 
> Do you have anything that backs up the claim that this is the case for "current implementations"? Maybe @sviswa7 can help answering if this is still the case for Intel hardware?

>From my understanding:
Padding to 64 byte is needed to avoid cache line false sharing.
Padding to 256 byte is recommended for heavily accessed contended data to avoid false sharing induced by prefetchers.
Padding to 128 byte may be sufficient for general contended data.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16973#issuecomment-1843830251


More information about the hotspot-dev mailing list