Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

padding out CPU cache lines #690

Open
981377660LMT opened this issue Jan 4, 2025 · 2 comments
Open

padding out CPU cache lines #690

981377660LMT opened this issue Jan 4, 2025 · 2 comments

Comments

@981377660LMT
Copy link
Owner

981377660LMT commented Jan 4, 2025

Memory bandwidth continues to be a limited resource in modern CPU architectures, so caching becomes extremely important to prevent performance bottlenecks. Modern multiprocessor CPUs cache data in small lines, typically 64 bytes in size, to avoid expensive trips to main memory. A write to a piece of memory will cause the CPU cache to evict that line to maintain cache coherency. A subsequent read on that address requires a refresh of the cache line. This is a phenomenon known as false sharing, and it’s especially problematic when multiple processors are accessing independent data in the same cache line.
内存带宽在现代 CPU 架构中仍然是一个有限资源,因此缓存变得极其重要,以防止性能瓶颈。现代多处理器 CPU 以小行缓存数据,通常大小为 64 字节,以避免昂贵的主内存访问。对一块内存的写入将导致 CPU 缓存驱逐该行,以保持缓存一致性。对该地址的后续读取需要刷新缓存行。这是一种称为虚假共享的现象,当多个处理器访问同一缓存行中的独立数据时,这个问题尤其严重。

@981377660LMT
Copy link
Owner Author

@981377660LMT
Copy link
Owner Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant