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

Aleksey Shipilev shade at openjdk.org
Wed Dec 6 09:44:35 UTC 2023


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

> So, with all that said. Do we really need to keep this *2 in the x64 code?

Maybe, maybe not. Anyhow, let's not change multiple things at the same time. I am provisionally good with dropping `*2`, as long as we have a targeted study on its effects or the absence of them, and/or Intel and AMD folks agree this should go.

What this change does is clearly separating the notions of "this is what we expect the cache line to be on given platform" (`DEFAULT_CACHE_LINE_SIZE`) and "this is how by how much we should pad" (`DEFAULT_PADDING_SIZE`). While I agree both might be the same value for known platforms, they convey different _intents_. This is also why, AFAICS, C++ spec calls it `hardware_{constructive,destructive}_interference_size`, not just "cache line size". 

This PR effectively renames `DEFAULT_CACHE_LINE_SIZE` -> `DEFAULT_PADDING_SIZE`. We leave `DEFAULT_CACHE_LINE_SIZE` for cases where we want to know CL size outside the padding contexts.

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

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


More information about the hotspot-dev mailing list