# Cache Coherence

Cache coherence is the discipline and protocols for keeping shared data consistent across multiple processor caches in multiprocessor systems.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## From Token Changes to Task Failures: Bit Flips in a Shared KV-Cache Block

DevFeed: [From Token Changes to Task Failures: Bit Flips in a Shared KV-Cache Block](<https://devfeed.tech/articles/from-token-changes-to-task-failures-bit-flips-in-a-shared-kv-cache-block-141481.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.22243>)

Author: Yuji Yamamoto, Satoshi Matsuura

Published: 2026-11-18T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [text-generation](<https://devfeed.tech/topics/text-generation.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>)

Tags: [code-generation](<https://devfeed.tech/tags/code-generation.md>), [cs-ar](<https://devfeed.tech/tags/cs-ar.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [failures](<https://devfeed.tech/tags/failures.md>), [fault-injection](<https://devfeed.tech/tags/fault-injection.md>), [kv-cache](<https://devfeed.tech/tags/kv-cache.md>), [llm-serving](<https://devfeed.tech/tags/llm-serving.md>), [policy](<https://devfeed.tech/tags/policy.md>), [prefix-caching](<https://devfeed.tech/tags/prefix-caching.md>), [questions](<https://devfeed.tech/tags/questions.md>), [qwen3](<https://devfeed.tech/tags/qwen3.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [vllm](<https://devfeed.tech/tags/vllm.md>)

### AI overview

In a vLLM setup serving Qwen3-8B, software-injected flips to the most significant mantissa or sign bit in a shared system-prompt KV-cache block sometimes turned correct responses into wrong ones. The measured fraction varied sharply by task: on MBPP+ it was 2.3% for mantissa flips and 1.9% for sign flips, versus 59% and 60% on held-out TriviaQA. Harm also depended on how often requests produced errors even without a flip. Because affected responses resembled ordinary errors, the abstract argues for checking cached blocks rather than relying on output monitoring. These findings are limited to the described setup and four evaluated tasks.

### Source excerpt

arXiv:2611.22243v1 Announce Type: new Abstract: In LLM serving systems with prefix caching, each KV block of a shared system prompt is held in GPU memory as a single physical copy, which every request with that prompt reads. Our earlier work measured change and showed that one bit flip in such a block changes many later responses without making them visibly degenerate. This paper extends that work by measuring how often the changed responses are wrong. Using software fault injection into vLLM serving Qwen3-8B, we flip the most significant mantissa bit or the sign bit of a value in such a block. We score responses on four tasks: code generation, short-answer questions, multiple-choice reasoning, and refusal under a policy. The fraction of changes that turned a correct response wrong depended strongly on the task: 0.023 on MBPP+ and 0.59 on held-out TriviaQA at the mantissa bit, and 0.019 and 0.60 at the sign bit. Harm fell on requests whose sampled answers are sometimes wrong, so the damage of a flip depends on how common such requests are. Harmed responses looked like ordinary errors, so a flip should be detected by checking cached blocks rather than by monitoring outputs.

## Anatomy of a CPU: How Every Part of a Modern CPU Works Together

DevFeed: [Anatomy of a CPU: How Every Part of a Modern CPU Works Together](<https://devfeed.tech/articles/anatomy-of-a-cpu-how-every-part-of-a-modern-cpu-works-together-134713.md>)

Original publisher: [Read original article](<https://www.techspot.com/article/2000-anatomy-cpu/>)

Author: Julio Franco

Published: 2026-11-16T06:18:00Z

Content type: article

Language: en

Sources: [TechSpot](<https://devfeed.tech/sources/techspot.md>)

Topics: [cpu](<https://devfeed.tech/topics/cpu.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [accelerators](<https://devfeed.tech/tags/accelerators.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-accelerators](<https://devfeed.tech/tags/ai-accelerators.md>), [arm](<https://devfeed.tech/tags/arm.md>), [branch-prediction](<https://devfeed.tech/tags/branch-prediction.md>), [chiplets](<https://devfeed.tech/tags/chiplets.md>), [cpu](<https://devfeed.tech/tags/cpu.md>)

### AI overview

A modern CPU overlaps instruction work and predicts what it will need to keep its cores busy. It fetches instructions in blocks, decodes them into operations, and uses registers, execution units, and a cache hierarchy to process data. Branch prediction, pipelining, out-of-order execution, and prefetching improve throughput, while speculative execution can leave cache traces that create security risks. Modern processors also integrate GPUs, NPUs, and media or vector accelerators. Multiple cores communicate through an on-chip interconnect and coordinate shared data; hybrid cores and chiplets balance performance, efficiency, and manufacturing cost with scheduling and communication tradeoffs. The article presents these as general features, since manufacturers keep circuit details proprietary, and illustrates them with AMD Zen 5.

### Source excerpt

What actually happens inside a CPU? We break down the key parts of a modern processor, from fetching and decoding instructions to caches, branch prediction, chiplets and AI accelerators. Read Entire Article

## Scaling Data Movement For Physical AI

DevFeed: [Scaling Data Movement For Physical AI](<https://devfeed.tech/articles/scaling-data-movement-for-physical-ai-91875.md>)

Original publisher: [Read original article](<https://semiengineering.com/scaling-data-movement-for-physical-ai/>)

Author: Ed Sperling

Published: 2026-10-21T07:15:31Z

Content type: article

Language: en

Sources: [Semiconductor Engineering](<https://devfeed.tech/sources/semiconductor-engineering.md>)

Topics: [Physical AI](<https://devfeed.tech/topics/physical-ai.md>), [Chip design](<https://devfeed.tech/topics/chip-design.md>), [data-architecture](<https://devfeed.tech/topics/data-architecture.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [arteris](<https://devfeed.tech/tags/arteris.md>), [chip](<https://devfeed.tech/tags/chip.md>), [chiplets](<https://devfeed.tech/tags/chiplets.md>), [coherency](<https://devfeed.tech/tags/coherency.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [data-movement](<https://devfeed.tech/tags/data-movement.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [physical-ai](<https://devfeed.tech/tags/physical-ai.md>), [semiconductor-engineering](<https://devfeed.tech/tags/semiconductor-engineering.md>), [system-level-design](<https://devfeed.tech/tags/system-level-design.md>), [videos](<https://devfeed.tech/tags/videos.md>)

### AI overview

Physical AI systems must process real-time data across mixed compute elements while making decisions and preserving battery life, so engineers need to decide where data is processed and minimize its movement. Ashley Stevens of Arteris says coherent interconnects are better suited to CPUs, while non-coherent interconnects are better for AI acceleration. The excerpt identifies these design choices as key challenges but provides no further detail on implementation or other challenges.

### Source excerpt

One size does not fit all. The post Scaling Data Movement For Physical AI appeared first on Semiconductor Engineering.

## Connecting Chiplets Isn't Enough - Solving the Data Movement Challenge in Multi-Die Systems

DevFeed: [Connecting Chiplets Isn't Enough - Solving the Data Movement Challenge in Multi-Die Systems](<https://devfeed.tech/articles/connecting-chiplets-isn-t-enough-solving-the-data-movement-challenge-in-multi-die-systems-84024.md>)

Original publisher: [Read original article](<https://www.eetimes.com/connecting-chiplets-isnt-enough-solving-the-data-movement-challenge-in-multi-die-systems/>)

Author: Arteris

Published: 2026-10-09T14:21:07Z

Content type: release

Language: en

Sources: [EE Times](<https://devfeed.tech/sources/ee-times.md>)

Topics: [Data transmission](<https://devfeed.tech/topics/data-transmission.md>), [NVLink](<https://devfeed.tech/topics/nvlink.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>)

Tags: [analog](<https://devfeed.tech/tags/analog.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [architectures](<https://devfeed.tech/tags/architectures.md>), [bandwidth](<https://devfeed.tech/tags/bandwidth.md>), [bits](<https://devfeed.tech/tags/bits.md>), [business](<https://devfeed.tech/tags/business.md>), [chiplets](<https://devfeed.tech/tags/chiplets.md>), [coherence](<https://devfeed.tech/tags/coherence.md>), [community](<https://devfeed.tech/tags/community.md>), [compute](<https://devfeed.tech/tags/compute.md>), [data](<https://devfeed.tech/tags/data.md>), [data-movement](<https://devfeed.tech/tags/data-movement.md>), [designline](<https://devfeed.tech/tags/designline.md>), [digital](<https://devfeed.tech/tags/digital.md>), [education](<https://devfeed.tech/tags/education.md>), [ee-times](<https://devfeed.tech/tags/ee-times.md>), [ee-times-university](<https://devfeed.tech/tags/ee-times-university.md>), [eelife](<https://devfeed.tech/tags/eelife.md>), [eelive-electronic-design](<https://devfeed.tech/tags/eelive-electronic-design.md>), [eet](<https://devfeed.tech/tags/eet.md>), [electrical-engineering](<https://devfeed.tech/tags/electrical-engineering.md>), [electronic-components](<https://devfeed.tech/tags/electronic-components.md>), [electronic-engineering-times](<https://devfeed.tech/tags/electronic-engineering-times.md>), [electronics](<https://devfeed.tech/tags/electronics.md>), [embedded-systems](<https://devfeed.tech/tags/embedded-systems.md>), [fundamentals-courses](<https://devfeed.tech/tags/fundamentals-courses.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [learning](<https://devfeed.tech/tags/learning.md>), [mixed-signal](<https://devfeed.tech/tags/mixed-signal.md>), [news](<https://devfeed.tech/tags/news.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [part-search](<https://devfeed.tech/tags/part-search.md>), [product-search](<https://devfeed.tech/tags/product-search.md>), [qos](<https://devfeed.tech/tags/qos.md>), [scale](<https://devfeed.tech/tags/scale.md>), [security](<https://devfeed.tech/tags/security.md>), [semiconductors](<https://devfeed.tech/tags/semiconductors.md>), [software](<https://devfeed.tech/tags/software.md>), [system](<https://devfeed.tech/tags/system.md>), [tech-papers](<https://devfeed.tech/tags/tech-papers.md>), [technology](<https://devfeed.tech/tags/technology.md>), [video](<https://devfeed.tech/tags/video.md>), [webinars-plus-bitcasts](<https://devfeed.tech/tags/webinars-plus-bitcasts.md>)

### AI overview

This BitCast announcement describes a session on data movement in multi-die systems. It covers extending network-on-chip connectivity across die boundaries to maintain traffic behavior, bandwidth efficiency, and quality of service, along with coherent and non-coherent architectures and design partitioning considerations.

### Source excerpt

Join this BitCast and explore how extending NoC connectivity across die boundaries enables engineering teams to scale from monolithic SoCs to multi-die architectures. The post Connecting Chiplets Isn't Enough - Solving the Data Movement Challenge in Multi-Die Systems appeared first on EE Times.

## Cartridges: A Cache You Train, Not a Context You Fill

DevFeed: [Cartridges: A Cache You Train, Not a Context You Fill](<https://devfeed.tech/articles/cartridges-a-cache-you-train-not-a-context-you-fill-78496.md>)

Original publisher: [Read original article](<https://blog.everpuredata.com/perspectives/cartidges-a-cache-you-train-not-a-context-you-fill/>)

Author: Noah Kasmanoff

Published: 2026-10-02T13:00:00Z

Content type: article

Language: en

Sources: [Everpure](<https://devfeed.tech/sources/everpure.md>)

Topics: [Cache](<https://devfeed.tech/topics/cache.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Self Hosted AI Tools](<https://devfeed.tech/topics/self-hosted-ai-tools.md>)

Tags: [ai-and-machine-learning](<https://devfeed.tech/tags/ai-and-machine-learning.md>), [ai-infrastructure](<https://devfeed.tech/tags/ai-infrastructure.md>), [bandwidth](<https://devfeed.tech/tags/bandwidth.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [costs](<https://devfeed.tech/tags/costs.md>), [perspectives](<https://devfeed.tech/tags/perspectives.md>)

### AI overview

The article explains cartridges, a research approach that trains compact key-value caches offline and reuses them to support long-context AI inference with less GPU memory. It compares cartridges with in-context learning, retrieval, and fine-tuning, and discusses self-study training, reported benchmark results, and limits including model-specific training and static documents. The article says cartridges remain a research result and are not ready for enterprise-scale use.

### Source excerpt

Cartridges: A Cache You Train, Not a Context You Fill by Everpure Blog This article explores what cartridges are, how they use compact KV caches to streamline long-context inference, and how they can help reduce resource demands. The post Cartridges: A Cache You Train, Not a Context You Fill appeared first on Everpure Blog.

## A Network-on-Chip (NoC) For Multi-Die Devices

DevFeed: [A Network-on-Chip (NoC) For Multi-Die Devices](<https://devfeed.tech/articles/a-network-on-chip-noc-for-multi-die-devices-59315.md>)

Original publisher: [Read original article](<https://semiengineering.com/a-network-on-chip-noc-for-multi-die-devices/>)

Author: Ashley Stevens

Published: 2026-09-24T07:07:06Z

Content type: article

Language: en

Sources: [Semiconductor Engineering](<https://devfeed.tech/sources/semiconductor-engineering.md>)

Topics: [Network](<https://devfeed.tech/topics/network.md>), [Physical AI](<https://devfeed.tech/topics/physical-ai.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [protocols](<https://devfeed.tech/topics/protocols.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Humanoid Robots](<https://devfeed.tech/topics/humanoid-robots.md>)

Tags: [accelerators](<https://devfeed.tech/tags/accelerators.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-systems](<https://devfeed.tech/tags/ai-systems.md>), [architectures](<https://devfeed.tech/tags/architectures.md>), [arteris](<https://devfeed.tech/tags/arteris.md>), [automotive](<https://devfeed.tech/tags/automotive.md>), [blogs-sld](<https://devfeed.tech/tags/blogs-sld.md>), [cache-coherence](<https://devfeed.tech/tags/cache-coherence.md>), [data-movement](<https://devfeed.tech/tags/data-movement.md>), [devices](<https://devfeed.tech/tags/devices.md>), [humanoid-robots](<https://devfeed.tech/tags/humanoid-robots.md>), [industrial-robots](<https://devfeed.tech/tags/industrial-robots.md>), [inference](<https://devfeed.tech/tags/inference.md>), [interconnect](<https://devfeed.tech/tags/interconnect.md>), [interconnects](<https://devfeed.tech/tags/interconnects.md>), [multi-die](<https://devfeed.tech/tags/multi-die.md>), [network](<https://devfeed.tech/tags/network.md>), [network-on-chip](<https://devfeed.tech/tags/network-on-chip.md>), [noc](<https://devfeed.tech/tags/noc.md>), [noc-noc](<https://devfeed.tech/tags/noc-noc.md>), [physical-ai](<https://devfeed.tech/tags/physical-ai.md>), [system-level-design](<https://devfeed.tech/tags/system-level-design.md>)

### AI overview

The article examines using a Network-on-Chip to transport packetized traffic directly across die boundaries in chiplet-based systems. It argues that coherent die-to-die protocols designed for processor memory traffic are poorly matched to the large, continuous data streams exchanged by AI accelerators and physical AI systems.

### Source excerpt

Transporting the native packetized traffic of the NoC directly across die boundaries using a stable, invariant interface. The post A Network-on-Chip (NoC) For Multi-Die Devices appeared first on Semiconductor Engineering.

## Scaling Nextdoor's Datastores: Part 4

DevFeed: [Scaling Nextdoor's Datastores: Part 4](<https://devfeed.tech/articles/scaling-nextdoor-s-datastores-part-4-20343.md>)

Original publisher: [Read original article](<https://engblog.nextdoor.com/scaling-nextdoors-datastores-part-4-c9d3d3edcd34?source=rss----5e54f11cdfdf---4>)

Author: Ronak Shah

Published: 2025-03-19T15:08:57Z

Content type: article

Language: en

Sources: [Nextdoor](<https://devfeed.tech/sources/nextdoor.md>)

Topics: [consistency](<https://devfeed.tech/topics/consistency.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [cache-invalidation](<https://devfeed.tech/topics/cache-invalidation.md>), [database-consistency](<https://devfeed.tech/topics/database-consistency.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [blog](<https://devfeed.tech/tags/blog.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [but](<https://devfeed.tech/tags/but.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cache-control](<https://devfeed.tech/tags/cache-control.md>), [cache-invalidation](<https://devfeed.tech/tags/cache-invalidation.md>), [caching](<https://devfeed.tech/tags/caching.md>), [can](<https://devfeed.tech/tags/can.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [core](<https://devfeed.tech/tags/core.md>), [data](<https://devfeed.tech/tags/data.md>), [database](<https://devfeed.tech/tags/database.md>), [database-consistency](<https://devfeed.tech/tags/database-consistency.md>), [datastores](<https://devfeed.tech/tags/datastores.md>), [discuss](<https://devfeed.tech/tags/discuss.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [lua](<https://devfeed.tech/tags/lua.md>), [scaling](<https://devfeed.tech/tags/scaling.md>)

### AI overview

Nextdoor's approach prevents racing database writes from leaving a look-aside cache with stale data by assigning each row a database-generated, unique, monotonic version. A Postgres trigger initializes db_version to 1 on insert and increments it on update; the application retrieves the new version in a select within the update transaction. The cache stores the version in its metadata header, and Redis Lua functions atomically compare versions when setting or deleting entries. In the example, writer B's version 13 is accepted, while writer A's later cache write with version 12 is rejected as OLD. The excerpt focuses on racing writes; it says missed writes and other consistency cases are covered in Part 5. It cautions that row and version updates must be atomic and that timestamps may not be unique or monotonic.

### Source excerpt

In this part of the Scaling Nextdoor's Datastores blog series, we will see how the Core-Services team at Nextdoor keeps its cache consistent with database updates and avoids stale writes to the cache. In this post, we'll focus specifically on inconsistencies caused by racing writes and our solution. We'll discuss other causes and our full solution for consistent caching in the next installment of our blog: Part 5: A time-bounded eventually-consistent cache. Inconsistent Cache Caches can become inconsistent with the database for several reasons, such as: Racing Writes / Concurrent Updates: Multiple writes occurring simultaneously can result in a stale cache. Missed Writes / Failing to Update the Cache: Failure to update or set cache correctly after a database write. Delayed Cache Updates or Deletes: Slow propagation of updates or invalidation can leave the cache out of sync. Application-Level Bugs: Bugs in application side caching logic. Maintaining cache consistency with the database is crucial for data accuracy, especially in distributed systems with concurrent web requests. Consistent caching ensures reliable read-after-write behavior, improving performance and user experience. Without it, applications may face unpredictable behavior and user frustration. A well-designed caching system boosts performance, ensures consistency, and delivers up-to-date data even under high concurrency. Racing Writes Let's look at the scenario where two writers, A and B, update the same user in the database but write to the cache in a different order, causing the cache to become inconsistent with the database. Author's Note: In examples moving forward we'll use "User_1" to mean id=1 in the "users" table.Look-Aside Cache with two writers. Sequence of operations: Writer A updates the name of user_1 to Foo in the database. Writer B updates the name of the same user_1 to Bar in the database. Writer B updates the cache for user_1 with name = Bar. Writer A updates the cache for user_1 with

## Why Intel added cache partitioning

DevFeed: [Why Intel added cache partitioning](<https://devfeed.tech/articles/why-intel-added-cache-partitioning-77708.md>)

Original publisher: [Read original article](<https://danluu.com/intel-cat/>)

Published: 2015-10-04T00:00:00Z

Content type: article

Language: en

Sources: [Danluu](<https://devfeed.tech/sources/danluu.md>)

Topics: [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [intel](<https://devfeed.tech/topics/intel.md>), [Service fabric](<https://devfeed.tech/topics/service-fabric.md>)

Tags: [bandwidth](<https://devfeed.tech/tags/bandwidth.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [jenkins](<https://devfeed.tech/tags/jenkins.md>), [memory-bandwidth](<https://devfeed.tech/tags/memory-bandwidth.md>)

### AI overview

The article explains how datacenter operators can improve server utilization by co-locating latency-sensitive and lower-priority workloads. It describes resource isolation techniques, including Intel Cache Allocation Technology, and discusses limits involving memory bandwidth, cache contention, power, and networking.

### Source excerpt

Typical server utilization is between 10% and 50%. Google has demonstrated 90% utilization without impacting latency SLAs. Xkcd estimated that Google owns 2 million machines. If you estimate an amortized total cost of $4k per machine per year, that's $8 billion per year. With numbers like that, even small improvements have a large impact, and this isn't a small improvement. How is it possible to get 2x to 9x better utilization on the same hardware? The low end of those typical utilization numbers comes from having a service with variable demand and fixed machine allocations. Say you have 100 machines dedicated to Jenkins. Those machines might be very busy when devs are active, but they might also have 2% utilization at 3am. Dynamic allocation (switching the machines to other work when they're not needed) can get a typical latency-sensitive service up to somewhere in the 30%-70% range. To do better than that across a wide variety of latency-sensitive workloads with tight SLAs, we need some way to schedule low priority work on the same machines, without affecting the latency of the high priority work. It's not obvious that this is possible. If both high and low priority workloads need to monopolize some shared resources like the last-level cache (LLC), memory bandwidth, disk bandwidth, or network bandwidth, there we're out of luck. With the exception of some specialized services, it's rare to max out disk or network. But what about caches and memory? It turns out that Ferdman et al. looked at this back in 2012 and found that typical server workloads don't benefit from having more than 4MB - 6MB of LLC, despite modern server chips having much larger caches. For this graph, scale-out workloads are things like distributed key-value stores, MapReduce-like computations, web search, web serving, etc. SPECint(mcf) is a traditional workstation benchmark. "server" is old school server benchmarks like SPECweb and TPC . We can see that going from 4MB to 11MB of LLC has a small e

## Caches: LRU v. random

DevFeed: [Caches: LRU v. random](<https://devfeed.tech/articles/caches-lru-v-random-77642.md>)

Original publisher: [Read original article](<https://danluu.com/2choices-eviction/>)

Published: 2014-11-03T00:00:00Z

Content type: article

Language: en

Sources: [Danluu](<https://devfeed.tech/sources/danluu.md>)

Topics: [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [NUMA](<https://devfeed.tech/topics/numa.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-caches](<https://devfeed.tech/tags/cpu-caches.md>), [l3-cache](<https://devfeed.tech/tags/l3-cache.md>), [lru](<https://devfeed.tech/tags/lru.md>)

### AI overview

The article compares LRU, random, and multi-choice random cache eviction policies using SPEC CPU benchmarks across cache sizes and levels. LRU performs better in smaller caches, while 2-random and pseudo 3-random can outperform it in larger caches; the results also examine associativity and multi-level cache effects.

### Source excerpt

Once upon a time, my computer architecture professor mentioned that using a random eviction policy for caches really isn't so bad. That random eviction isn't bad can be surprising -- if your cache fills up and you have to get rid of something, choosing the least recently used (LRU) is an obvious choice, since you're more likely to use something if you've used it recently. If you have a tight loop, LRU is going to be perfect as long as the loop fits in cache, but it's going to cause a miss every time if the loop doesn't fit. A random eviction policy degrades gracefully as the loop gets too big. In practice, on real workloads, random tends to do worse than other algorithms. But what if we take two random choices (2-random) and just use LRU between those two choices? Here are the relative miss rates we get for SPEC CPU1 with a Sandy Bridge-like cache (8-way associative, 64k, 256k, and 2MB L1, L2, and L3 caches, respectively). These are ratios (algorithm miss rate : random miss rate); lower is better. Each cache uses the same policy at all levels of the cache. Policy L1 (64k) L2 (256k) L3 (2MB) 2-random 0.91 0.93 0.95 FIFO 0.96 0.97 1.02 LRU 0.90 0.90 0.97 random 1.00 1.00 1.00 Random and FIFO are both strictly worse than either LRU or 2-random. LRU and 2-random are pretty close, with LRU edging out 2-random for the smaller caches and 2-random edging out LRU for the larger caches. To see if anything odd is going on in any individual benchmark, we can look at the raw results on each sub-benchmark. The L1, L2, and L3 miss rates are all plotted in the same column for each benchmark, below: As we might expect, LRU does worse than 2-random when the miss rates are high, and better when the miss rates are low. At this point, it's not clear if 2-random is beating LRU in L3 cache miss rates because it does better when the caches are large or because it does better because it's the third level in a hierarchical cache. Since a cache line that's being actively used in L1 or L2 isn't

## Data alignment and caches

DevFeed: [Data alignment and caches](<https://devfeed.tech/articles/data-alignment-and-caches-77643.md>)

Original publisher: [Read original article](<https://danluu.com/3c-conflict/>)

Published: 2014-01-02T00:00:00Z

Content type: article

Language: en

Sources: [Danluu](<https://devfeed.tech/sources/danluu.md>)

Topics: [Cache Coherence](<https://devfeed.tech/topics/cache-coherence.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [cache](<https://devfeed.tech/tags/cache.md>), [chip](<https://devfeed.tech/tags/chip.md>), [data](<https://devfeed.tech/tags/data.md>), [performance](<https://devfeed.tech/tags/performance.md>), [westmere](<https://devfeed.tech/tags/westmere.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

The article explains how page-aligned memory accesses can cause cache conflict misses by mapping repeatedly to a limited set of cache locations. Using a benchmark and cache hierarchy examples from Sandy Bridge and Westmere, it shows why misaligned accesses can perform better for certain working set sizes.

### Source excerpt

Here's the graph of a toy benchmark1 of page-aligned vs. mis-aligned accesses; it shows a ratio of performance between the two at different working set sizes. If this benchmark seems contrived, it actually comes from a real world example of the disastrous performance implications of using nice power of 2 alignment, or page alignment in an actual system2. Except for very small working sets (1-8), the unaligned version is noticeably faster than the page-aligned version, and there's a large region up to a working set size of 512 where the ratio in performance is somewhat stable, but more so on our Sandy Bridge chip than our Westmere chip. To understand what's going on here, we have to look at how caches organize data. By way of analogy, consider a 1,000 car parking garage that has 10,000 permits. With a direct mapped scheme (which you could call 1-way associative3), each of the ten permits that has the same 3 least significant digits would be assigned the same spot, i.e., permits 0618, 1618, 2618, and so on, are only allowed to park in spot 618. If you show up at your spot and someone else is in it, you kick them out and they have to drive back home. The next time they get called in to work, they have to drive all the way back to the parking garage. Instead, if each car's permit allows it to park in a set that has ten possible spaces, we'll call that a 10-way set associative scheme, which gives us 100 sets of ten spots. Each set is now defined by the last 2 significant digits instead of the last 3. For example, with permit 2618, you can park in any spot from the set {018, 118, 218, ..., 918}. If all of them are full, you kick out one unlucky occupant and take their spot, as before. Let's move out of analogy land and back to our benchmark. The main differences are that there isn't just one garage-cache, but a hierarchy of them, from the L14, which is the smallest (and hence, fastest) to the L2 and L3. Each seat in a car corresponds to an address. On x86, each addresses po