L3 Cache
In this article, we have explained the idea of L3 cache, its importance, differences compared to other types of cache and how to check L3 cache size in your system.
Table of contents:
- L3 Cache
- L3 Cache Size
- Check L3 Cache Size in your System
- Differences between L3 and L1, L2 cache
L3 Cache
L3 cache stands for "Level 3 Cache".
L3 Cache is a cache that is shared among multiple CPU cores. This is in contrast to L1 and L2 cache which is not usually shared among cores.
The size of L3 Cache is significantly larger compared to L1 and L2 cache.
Larger the size of L3 cache, more is the performance of the system in general.
The main points of L3 cache are:
- L3 cache is the largest cache in the system.
- L3 cache is level 3 cache and is linked to L2 cache.
- L3 cache is the slowest cache in the system.
- L3 cache is shared among CPU cores in a cluster. Each cluster has separate L3 cache.
L3 cache is very important for overall System Performance. The trend of new systems is to increase the size of L3 cache. Infact, L3 cache is the most important Processor Cache compared to L1 and L2 cache for overall performance impact.
L3 Cache Size
Usually, size of L3 cache vary from 4MB to 64MB. Higher the L3 cache size, Higher is the System Performance in general.
Following table lists the L3 cache size of different production systems:
L3 cache size | |
---|---|
Size in MB (Mega Byte) | |
Intel IceLake | 60 MB |
Intel CooperLake | 38.5 MB |
Intel CascadeLake | 38.5 MB |
Intel Skylake | 2 MB per core |
Intel Gracemont | 3 MB per core |
AMD Ryzen 3 3100 | 16 MB |
AMD Ryzen Threadripper Pro 3995WX | 256 MB |
AMD Ryzen 9 5950X | 64 MB |
Check L3 Cache Size in your System
To find the total L3 Cache available in your system, use the following command in terminal:
lscpu
It will provide several information including the L3 cache size. A part of the output:
...
L3 cache: 16384K
...
So, from the above output, the size of L3 cache is 16384K bytes which converts to 16MB.
To know how L3 cache is shared among different CPU cores, use the following commands:
lstopo
OR
lstopo-no-graphics
This will give the complete Cache Infrastructure of the system. A part of the output will be like:
L3 L#1 (4MB)
L2 L#12 (256KB) + L1d L#12 (16KB) + L1i L#12 (16KB) + Core L#12
PU L#12 (P#12)
L2 L#13 (256KB) + L1d L#13 (16KB) + L1i L#13 (16KB) + Core L#13
PU L#12 (P#13)
L2 L#14 (256KB) + L1d L#14 (16KB) + L1i L#14 (16KB) + Core L#14
PU L#12 (P#14)
L2 L#15 (256KB) + L1d L#15 (16KB) + L1i L#15 (16KB) + Core L#15
PU L#12 (P#15)
So, from the above information, we see that in this particular system, a single L3 cache of size 4MB is shared among 4 CPU cores. The 4 CPU cores have their own L2 and L1 (Instruction + Data) cache.
Differences between L3 and L1, L2 cache
The Differences between L3 and L1, L2 cache are:
- L3 cache is shared among multiple (>=2) CPU cores while L1 and L2 cache is not shared among CPU cores.
- L3 cache size >>> L1 cache size, L2 cache size.
- L1 cache is divided into two parts: Instruction and Data. On the other hand, L2 and L3 cache are used for Data only.
Following table summarizes the differences between L1, L2 and L3 cache:
L1 vs L2 vs L3 cache | |
---|---|
Differences between L1, L2 and L3 cache | |
Speed | L1 > L2 > L3 |
Size | L3 > L2 > L1 |
Sharing | L3 is shared among CPU cores L1, L2 is not shared. |
Data, Instruction cache | L1 is both data and instruction. L2, L3 is only data cache |
Location | L1 is in CPU core L2: in chip, outside CPU core L3 outside chip |
With this article at OpenGenus, you must have the complete idea of L3 (level 3) cache.