yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.96k stars 1.07k forks source link

Check cache line size on aarch64 #9218

Open mbautin opened 3 years ago

mbautin commented 3 years ago

We will initially set CACHELINE_SIZE to 64 on aarch64, but this needs to be confirmed / verified (also check how we use this).

#define CACHELINE_SIZE 64
xpepermint commented 3 weeks ago

Coming from Rust, using 128 for aarch64 will cause issues. It has been confirmed from multiple sources, including the ARM Developer documentation, that the default cache line size on many aarch64 systems, including the Apple M1, is 64 bytes. This is standard across most ARM-based processors. However, ARM chips, like some Intel processors, may use prefetching mechanisms that allow the CPU to fetch more than one cache line at a time (e.g., two 64-byte cache lines), leading to the observation of 128-byte blocks being prefetched in certain contexts.