L2 Memory Cache on Multi-Core CPUs
On CPUs with more than one core the L2 cache architecture varies a lot, depending on the CPU.
On Pentium D and AMD dual-core CPUs based on K8 architecture each CPU core has its own L2 memory cache. So each core works as if it were a completely independent CPU.
On Intel dual-core CPUs based on Core and Pentium M microarchitectures, there is only L2 memory cache, which is shared between the two cores.
Intel says that this shared architecture is better, because on the separated cache approach at some moment one core may run out of cache while the other may have unused parts on its own L2 memory cache. When this happens, the first core must grab data from the main RAM memory, even though there was empty space on the L2 memory cache of the second core that could be used to store data and prevent that core from accessing the main RAM memory. So on a Core 2 Duo processor with 4 MB L2 memory cache, one core may be using 3.5 MB while the other 512 KB (0.5 MB), contrasted to the fixed 50%-50% division used on other dual-core CPUs.
On the other hand, current quad-core Intel CPUs like Core 2 Extreme QX and Core 2 Quad use two dual-core chips, meaning that this sharing only occurs between cores 1 & 2 and 3 & 4. In the future Intel plans to launch quad-core CPUs using a single chip. When this happens the L2 cache will be shared between the four cores.
In Figure 3, you can see a comparison between these three L2 memory cache solutions.
AMD processors based on K10 architecture will have a shared L3 memory cache inside the CPU, being a hybrid between the other two approaches. This is shown in Figure 4. The size of this cache will depend on the CPU model, just like what happens with the size of L2 cache.