Interview Question: Can L2 Cache Be Removed When Using Only a Single Cortex-A Core?

Even when using only a single Cortex-A core, the L2 cache cannot be eliminated. Students at the Jingxin Training Camp have asked this question before, and the role of L2 cache is crucial. Why is that? The core issue is that the CPU operates too quickly, while accessing the external main memory is too slow. The L2 cache acts as a high-speed intermediary storage between the CPU core (even a single core) and the main memory. It holds the data and instructions that the CPU has recently used or is likely to use soon.

Interview Question: Can L2 Cache Be Removed When Using Only a Single Cortex-A Core?

Even with just one core, program execution follows a pattern: it often repeatedly uses the same data or reads a contiguous area (this is called program locality). The L1 cache is closest to the core and the fastest, but it has a small capacity and can fill up quickly. Once the required data is not found in L1 (cache miss), if there is no L2 cache at that moment, the CPU will have to wait for the slow main memory to retrieve the data, which can lead to significant performance loss. The L2 cache has a larger capacity, allowing it to store more hot data, greatly reducing this waiting time. Removing the L2 cache would have serious consequences: performance would drop significantly because the CPU would spend most of its time waiting for memory. Worse still, accessing the main memory actually consumes more power, so eliminating the L2 cache might even increase overall power consumption. The entire system’s responsiveness would slow down and become laggy, making real-time tasks even less reliable. Of course, the L2 cache does occupy chip area and increase costs. However, it might only be considered for removal in those special scenarios where cost is extremely sensitive, and performance requirements are low enough to run only very simple code (small enough to fit entirely in L1 cache). But such extreme cases are very rare and usually not worth the trade-off. A single-core Cortex-A also needs L2 cache; it is key to overcoming the “slow memory” bottleneck. Without it, the powerful computing capability of the CPU is hindered by memory, preventing it from being fully utilized.

Interview Question: Can L2 Cache Be Removed When Using Only a Single Cortex-A Core?

Leave a Comment