How to detect whether the cpu second-level cache is damaged and explain the impact of the second-level cache on CPU performance

This article is mainly about the introduction of the two-level cache, and expounds the checking method of whether the second-level cache is damaged, and discusses the impact of the second-level cache on the CPU performance.

Secondary cache

The working principle of the second-level cache is that when the CPU wants to read a piece of data, it first looks it up in the cache, and if it finds it, it reads it immediately and sends it to the CPU for processing; if it doesn’t find it, it reads it from the memory at a relatively slow speed. Send it to the CPU for processing, and at the same time transfer the data block where the data is located into the cache, so that the entire block of data can be read from the cache in the future without calling the memory.

It is this read mechanism that makes the CPU read cache hit rate very high (most CPUs can reach about 90%), which means that 90% of the data that the CPU will read next time are in the cache, only about 10% Need to read from memory. This greatly saves the time for the CPU to directly read the memory, and also makes the CPU basically no need to wait when reading data. In general, the order in which the CPU reads data is cached first and then memory. The earliest CPU cache is a whole, and the capacity is very low, Intel has classified the cache since the Pentium era. At that time, the cache integrated in the CPU core was not enough to meet the needs of the CPU, and the limitations on the manufacturing process could not greatly increase the capacity of the cache. Therefore, there is a cache integrated on the same circuit board or motherboard as the CPU. At this time, the cache integrated with the CPU core is called the first level cache, and the external one is called the second level cache. The first level cache is also divided into data cache (Data Cache, D-Cache) and instruction cache (InstrucTIon Cache, I-Cache). The two are respectively used to store data and execute instructions for these data, and both can be accessed by the CPU at the same time, reducing conflicts caused by contention for Cache, and improving processor performance.

How to detect whether the cpu secondary cache is damaged

It can be viewed through CPU-Z:

Baidu search CPU-Z, and download and install;

Run the installed software, you can see the second-level cache information on the interface:

How to detect whether the cpu second-level cache is damaged? Explain the impact of the second-level cache on CPU performance

The solution to the second-level cache corruption

If the system crashes frequently at the default frequency, it is likely that the second-level cache of this processor is defective, which makes it unable to operate stably. In the face of this situation, in addition to replacing the processor, another solution is to shield the second-level cache of the CPU in the BIOS. The operation method is relatively simple, press and hold "Delete" when booting to enter the BIOS interface. Use the arrow keys on the keyboard to operate, and find the "CPU Level 2 Cache" option (as shown in the figure), and change the following parameters from "Enabled" to "Disabled". After saving and exiting, restart the computer, and the computer can run stably. However, it should be noted that since turning off the secondary cache will greatly reduce the performance of the processor, the performance of the system will be greatly affected. But even so, the Core processor with its powerful first-level cache, its performance is significantly better than the same frequency Pentium processor.

Since the current new motherboards basically do not have a BIOS design that disables the secondary cache, the above method is no longer applicable to the current new motherboards. When conditions permit, it is best not to buy ES version processors. Because this type of processor is originally an engineering sample, it is inevitable that there may be various hidden problems. Even if you want to buy the ES version of the processor for a cheap price, it is best to choose a seller in the same city and ask the other party to provide the same warranty service as the bulk official version of the processor. And if the other party refuses to provide the warranty, or does not agree to write the warranty terms in black and white, then the ES version of the processor you want to buy is likely to be tricky.

Explain the impact of secondary cache on CPU performance

The CPU secondary cache capacity of modern desktop PCs is mostly between 64KB and 2MB. Because the CPU L2 cache capacity has a significant impact on CPU performance, the difference in physical structure between low-end CPUs and mid-to-high-end CPUs is mainly the size of the L2 cache capacity. So why is the L2 cache capacity so important? What effect does it have on CPU performance?

As mentioned in "Talking about the CPU Cache Hierarchy", the CPU second-level cache serves as the "backup warehouse" of the first-level cache, which is used to store more data for the first-level cache and reduce the number of times the CPU directly accesses the memory. In theory, the larger the proportion of the data that the CPU accesses and calls the cache, the smaller the proportion of the data that the CPU accesses and calls the memory, and the less time is lost due to access to the memory. Therefore, the larger the cache capacity, the higher the actual efficiency of the CPU and the stronger the performance.

In fact, Intel and AMD processors are different in the logical structure design of the first level cache, so the impact of the second level cache on the CPU performance is also different. Because 80% of the data (including instructions) read by the CPU comes from the first-level cache, the logical structure of the first-level cache determines the impact of the CPU's second-level cache capacity on the performance of the CPU. The primary data cache of Intel’s PenTIum 4 and Celeron series processors is called "data code instruction trace (read and write) cache"; the primary data cache of AMD’s Athlon 64/Athlon XP/Sempron/Duron series processors is called "Real data read and write cache".

What is the difference between the logical structure of the two types of CPU level 1 caches? Below, I use an example to describe.

Suppose there is an arithmetic task, which has to be incremented from "1" to "999999". Under the traditional "real data read and write cache" architecture, the first data used in this series of data (such as "1, 2...449, 450") will be stored in the CPU level one data cache, and more The data (such as "451, 452...899999, 900000") is stored in the second-level cache of the CPU, and the rest of the data (such as "900001, 999002...999998, 999999") is temporarily stored in the memory, and the CPU will be cached according to the first-level data , L2 cache and memory read these data sequentially.

[#Img_367743_no_1_Black#]

Traditional first-level data cache storage method

However, in the CPU of the "data code instruction trace cache" architecture, the first-level data cache does not store the first used data ("1, 2...449, 450"), but stores these data to the second-level In the cache, the first-level data cache only stores the start and end addresses (also known as instruction codes) of these data in the second-level cache. For example, the data "1, 2...449, 450" are stored in the L2 cache in order, the address of the data "1" is "00001F", and the address of the data "450" ​​is "00451F". In fact, the first level data cache only The two addresses of "00001F" and "00451F" need to be stored, instead of storing a large amount of data.

[#Img_367747_no_1_Black#]

The storage method of the first-level data cache of the "data code instruction trace cache" architecture

However, because the first-level data cache does not store data, the data is stored in the second-level cache, so the dependence on the capacity of the second-level cache is very large, so the CPU needs a larger second-level cache capacity to play its due performance. In practical applications, most of the data processed by the CPU is 0KB~128KB data, 128KB~256KB data is about 10%, 256KB~512KB data is 5%, 512KB~1MB data is only about 3% . So for this kind of CPU, the increase in the secondary cache capacity from 0KB to 256KB will increase the CPU performance almost linearly; the increase to 512KB will increase the CPU performance slightly; the increase from 512KB to 1MB is very much for ordinary users. It is difficult to realize that the CPU performance has improved. Because of this, everyone can feel the performance difference between PenTIum 4 C (512KB L2 cache) and Celeron (128KB L2 cache), but it is difficult to feel PenTIum 4 C (512KB L2 cache) and Pentium 4 E (1MB two Level cache) performance difference.

[#Img_367748_no_1_Black#]

Probability distribution graph of CPU processing data size

For example, Celeron D (256KB L2 cache) and Pentium 4 E (1MB L2 cache), both with a 2.8GHz frequency, took 56 seconds and 48 seconds to compute super π 1.04 million bits, respectively. Excluding the FSB (the former is 133MHz, the latter is 200MHz) and the impact of hyper-threading technology, the performance gap between the two is only about 10%, for ordinary users, such a performance gap is insignificant; only players who have "critical" CPU computing performance requirements A larger secondary cache capacity is necessary.

[#Img_367749_no_1_Black#]

Celeron D

[#Img_367750_no_1_Black#]

Pentium 4 E

In contrast, because AMD’s Athlon 64/Athlon XP/Sempron/Duron series products store data directly in the first-level data cache, and the 128KB capacity can bear the urgently needed data by the CPU in most cases, so its second-level cache is The impact of CPU performance is not that big. This also explains why Athlon XP (256KB or 512KB L2 cache) and Duron (64KB L2 cache) with the same main frequency and FSB have a huge difference in L2 cache capacity, but the actual performance gap is not big. Moreover, the Athlon 64/Sempron series CPUs are different from previous products in many aspects such as memory controller, pipeline length, frequency, bus architecture, and extended instruction set, so the performance is less affected by the capacity of the secondary cache.

[#Img_367751_no_1_Black#]

Sempron

[#Img_367752_no_1_Black#]

Athlon 64

To sum up, in terms of CPU performance, not only can you get an accurate answer from the comparison of the capacity of the second-level cache, in fact, you must also consider factors such as the overall design structure of the cache and the capacity of the first-level data cache. Although generally speaking, the larger the L2 cache capacity, the better, but it is not that doubling the L2 cache capacity can double the CPU performance. Therefore, for ordinary home users, computers are mainly used for surfing the Internet, enjoying music and movies, and word processing. Celeron D or Sempron with a secondary cache of 256KB is sufficient. Only users with higher requirements for 3D games, office software and multimedia editing performance need a larger secondary cache CPU.

Conclusion

This is the end of the introduction to the second-level cache. I hope this article will give you a more comprehensive understanding of the second-level cache. If you have any deficiencies, please correct me.

Nylon Braided Sleeve

Nylon Braided Sleeve,Nylon Sleeving,Nylon Braided Cable Sleeve,Nylon Braided Hose Sleeve

Shenzhen Huiyunhai Tech.Co., Ltd. , https://www.cablesleevefactory.com