CPU, cache, memory, external memory concept mining

table of Contents

 

A: Cache

Two: CPU 

(1) Composition

(2) Why do we need buffer

(3) the role of

Multi-level cache (4) CPU's

 

Three: the difference between running memory and physical memory and virtual memory

Four: the difference between memory and external memory

Five: Reference article


A: Cache


Definition: Any of the velocity difference between the two hardware larger, both the structure for coordinating data transfer speed difference, called Cache can
be extended concepts: Today cache concept has been expanded, not only in the main CPU and between memory cache, and between memory and hard drive are also cache (disk cache), and even between the hard disk and the network also has a sense of Cache── called temporary Internet files folder or web content caching.

Data storage: memory, CPU is the most frequently accessed data and instructions are copied into the CPU cache

: Effect of
the structure for coordinating the transmission speed of both the difference data

Practical examples:
cache is part of CPU (Central Processing Unit) in the
cache (Cache memory) is a memory chip on a hard disk controller
(cache on the hard disk: hard disk access when fragmented data need to constantly exchanged between the hard disk and memory data)


Two: CPU 


(1) Composition

 

Usually the arithmetic logic unit, a control unit and a storage unit (register) composed of

(2) Why do we need buffer


Case in point:
1. because the cache memory is only a small part of the data replica, so the CPU to find the cache data, will not find the situation appears (because the data is not copied from the cache memory to go), then the CPU or will look for data in memory, the speed of such a system will slow down, but the CPU will copy the data to the cache go to the next and then do not pick up the memory. 2. because over time, the most frequently accessed data is not static, that is to say, just do not frequent data, this time has to be frequently accessed, or just the most frequent data, not now frequent, so that the data in the cache should always be replaced in accordance with certain algorithms, so as to ensure that data in the cache is being accessed most frequently

(3) the role of


1, reduce latency

Cache access time should be as short as possible, the time can be shortened by a variety of ways, such as being able to reduce the delay, as well as the cache way prediction by reducing the size of the cache, or association, or the like to increase bandwidth.

2, to enhance hit rate
so-called hit rate is the rate found in the cache memory references, we want to first obtain information through the cache to get the speed advantage, so the cache needs to achieve this maximum. For a single cache, size, relevance and block size determination hit rate.

3, reducing the cost at a lower level memory

Cache is part of the memory hierarchy, and its performance can affect the performance of other, longer processing time it takes other memory, the lower the mean performance of the system, that make possible the completion of the processing in the cache.

4, reducing missed punishment

The cache can not hit things can not be avoided, but we can reduce the processing time required to miss to get a better processor performance by increasing the hit rate and by applying different optimization can reduce missed penalty.

CPU cache is a very important part, take a lot of resources and overhead costs, if you read CPU architecture diagram, you will find the cache occupies at least 50% of the area, is absolutely essential.


Multi-level cache (4) CPU's

 

Level cache (L1 Cache)

CPU cache, refers to the first level cache of the CPU, the main job is supported when the instruction cache and data cache. The impact of cache capacity and structure is very big on CPU performance, but because of its complex structure, taking into account cost and other factors, generally speaking, the smaller the CPU cache, the cache is usually the CPU will also be able do about 256KB level.

Secondary cache (L2 Cache66)

CPU cache, refers to the second level cache of the CPU, the secondary cache capacity will directly affect the performance of the CPU, the secondary cache capacity the better. For example, eighth-generation intel i7-8700 processor, a total of six the number of cores, and each core has 256KB of secondary cache, belonging to each core exclusive, so the total number of secondary cache reached 1.5MB.

Three-level cache (L3 Cache)

CPU L3 cache, refers to the third level cache of the CPU, whose role is to further reduce the memory latency, while improving performance when massive amounts of data is calculated. And a cache, L2 cache is different, three-level cache is shared core, the capacity will be able to do much.

The number of CPU cores, high-frequency level will affect the performance, but if CPU smarter and more efficient to perform computing tasks, then the cache of role is essential.

Three: the difference between running memory and physical memory and virtual memory


Running memory refers to physical memory

Case in point:
a running process, his memory is required memory capacity may be greater than the sum of: for example, your memory is 256M, you have to create the program data area of a 2G.
So not all data can be loaded into memory together (physical memory), there is bound to be part of the data into other media (such as hard disk).
To be part of that process needs to access data, scheduled to enter in through the physical memory.

Virtual memory is the sum of all the memory space of the process is running, and may not have a part of physical memory (also known as virtual memory to swap memory)
of physical memory is the memory we usually know

Four: the difference between memory and external memory


External memory: a magnetic or optical media, like hard disks, floppy disks, tape, CD,
internal memory (RAM): physical essence is provided with one or more groups of data input and output, and data storage function IC 


Five: Reference article


https://blog.csdn.net/as02446418/article/details/47913387
https://zhidao.baidu.com/question/4890990.html
 

Guess you like

Origin blog.csdn.net/weixin_39966065/article/details/93517527