Skip to content

Revisit cache line size constants #2197

@riemass

Description

@riemass

Currently, we use CAF_CACHE_LINE_SIZE with the value of 64 bytes to prevent false sharing in the actor_control_block and default_mailbox.

Intel and AMD use 64, but Apple Silicone switched to 128 bytes with the M-series processors. However, research suggests that internally, the cache line size is still 64 bytes, although reported as 128.

Regarding cache-line size, sysctl on macOS reports a value of 128 B, while getconf and the CTR_EL0 register on Asahi Linux returns 64 B, which is also supported by our measurements. [1]

While getting the cacheline size via software gives us 128 bytes, I think physically it is actually 64 bytes. In this benchmark even if you change the alignment to 64, the performance remains exactly the same. [2]

The research lowers the priority of this task, but we should handle it properly. Here are some suggestions how to do it:

  • a CMake generated constant in build_config,
  • use the std library,
  • use fixed 128 bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions