How to set up smartphones and PCs. Informational portal
  • home
  • Windows 7, XP
  • The fastest cache in the processor. Mathematical and engineering calculations

The fastest cache in the processor. Mathematical and engineering calculations

cache - memory (cache, cash, buffer- eng.) - used in digital devices as a high-speed clipboard. Cache memory can be found on computer devices such as processors, network cards, CD drives, and many others.

The principle of operation and architecture of the cache can be very different.

For example, a cache can serve as a normal clipboard . The device processes the data and transfers it to a high-speed buffer, where the controller transfers the data to the interface. Such a cache is intended to prevent errors, hardware check data for integrity, or to encode the signal from the device into an understandable signal for the interface, without delays. This system is used, for example, in CD/DVD CD drives.

Otherwise, the cache may serve to storing frequently used code and thereby speed up data processing. That is, the device does not need to recompute or look up the data, which would take much longer than reading it from the cache. In this case, the size and speed of the cache plays a very important role.

This architecture is most often found on hard drives, and central processing units ( CPU).

When devices are working, special firmware or dispatcher programs can be loaded into the cache, which would work slower with ROM(permanent storage device).

Most modern devices use mixed cache type , which can serve as both a clipboard and a place to store frequently used code.

There are several very important functions implemented for the cache of processors and video chips.

Consolidation of execution units . CPUs and video processors often use a fast shared cache between cores. Accordingly, if one core processed the information and it is in the cache, and a command arrives for the same operation, or for working with this data, then the data will not be processed by the processor again, but will be taken from the cache for further processing. The kernel will be offloaded to process other data. This significantly increases performance in the same type, but complex calculations, especially if the cache is large and fast.

Shared Cache, also allows kernels to work with it directly, bypassing the slow .

Cache for instructions. There is either a general very fast first-level cache for instructions and other operations, or a dedicated one for them. The more embedded instructions a processor has, the larger the instruction cache it needs. This reduces memory latency and allows the instruction block to function almost independently.

Other functions and features.

It is noteworthy that in CPU(central processing units), applies hardware error correction (ECC), because a small error in the cache can lead to one continuous error in further processing of this data.

AT CPU and GPU exist cache hierarchy , which allows you to separate data for individual cores and general. Although almost all data from the second level cache is still copied to the third, general level, but not always. The first cache level is the fastest, and each subsequent one is slower, but larger in size.

For processors, it is normal to three and less cache levels. This allows you to achieve a balance between speed, cache size and heat dissipation. It is difficult to find more than two levels of cache in video processors.

Cache size, performance impact and other characteristics.

Naturally, the more cache, the more data it can store and process, but there is a serious problem.

Big cash- This big budget. In server processors ( CPU), the cache can use up to 80% transistor budget. Firstly, this affects the final cost, and secondly, power consumption and heat dissipation increase, which is not comparable with a performance increased by several percent.

All users are well aware of such elements of a computer as a processor responsible for processing data, as well as random access memory (RAM or RAM) responsible for storing them. But not everyone probably knows that there is also a processor cache (Cache CPU), that is, the RAM of the processor itself (the so-called super-RAM memory).

What is the reason that prompted computer developers to use special memory for the processor? Isn't RAM enough for a computer?

Indeed, for a long time, personal computers did without any kind of cache memory. But, as you know, the processor is the fastest device in a personal computer and its speed has grown with each new generation of CPU. Currently, its speed is measured in billions of operations per second. At the same time, standard RAM has not significantly increased its performance over the course of its evolution.

Generally speaking, there are two main technologies for memory chips - static memory and dynamic memory. Without delving into the details of their structure, we will only say that static memory, unlike dynamic memory, does not require regeneration; in addition, 4-8 transistors are used for one bit of information in static memory, while 1-2 transistors are used in dynamic memory. Accordingly, dynamic memory is much cheaper than static memory, but at the same time much slower. Currently, RAM chips are manufactured on the basis of dynamic memory.

Approximate evolution of the ratio of the speed of processors and RAM:

Thus, if the processor took information from the main memory all the time, then it would have to wait for the slow dynamic memory, and it would be idle all the time. In the same case, if static memory were used as RAM, then the cost of the computer would increase several times.

That is why a reasonable compromise was developed. The main part of the RAM remained dynamic, while the processor got its own fast cache based on static memory chips. Its volume is relatively small - for example, the volume of the L2 cache is only a few megabytes. However, here it is worth remembering that all the RAM of the first IBM PC computers was less than 1 MB.

In addition, the expediency of implementing caching technology is also affected by the fact that different applications in RAM load the processor differently, and, as a result, there is a lot of data that requires priority processing compared to the rest.

History of the cache

Strictly speaking, before the cache memory moved to personal computers, it had been successfully used in supercomputers for several decades.

For the first time, a cache memory of only 16 KB appeared in a PC based on the i80386 processor. Today's processors use various levels of cache, from the first (the fastest cache of the smallest size - usually 128 KB) to the third (the slowest cache of the largest size - up to tens of MB).

At first, the processor's external cache memory was located on a separate chip. Over time, however, this led to the fact that the bus located between the cache and the processor became a bottleneck, slowing down data exchange. In modern microprocessors, both the first and second levels of cache memory are located in the processor core itself.

For a long time, there were only two levels of cache in processors, but for the first time in the Intel Itanium CPU, a third-level cache appeared, common to all processor cores. There are also developments of processors with a four-level cache.

Architectures and principles of cache operation

To date, two main types of cache memory organization are known, which originate from the first theoretical developments in the field of cybernetics - Princeton and Harvard architectures. The Princeton architecture implies a single memory space for storing data and commands, while the Harvard one has a separate one. Most personal computer processors of the x86 line use a separate type of cache memory. In addition, a third type of cache memory has also appeared in modern processors - the so-called associative translation buffer, designed to speed up the conversion of operating system virtual memory addresses into physical memory addresses.

Simplified, the scheme of interaction between the cache memory and the processor can be described as follows. First, the presence of the information needed by the processor is checked in the fastest - the first-level cache, then - in the second-level cache, and so on. If the necessary information was not found in any level of the cache, then they say about an error, or a cache miss. If there is no information in the cache at all, then the processor has to take it from RAM or even from external memory (from the hard disk).

The order in which the processor searches for information in memory:

This is how the processor searches for information

To control the operation of the cache memory and its interaction with the computing units of the processor, as well as the RAM, there is a special controller.

Scheme of organizing the interaction of the processor core, cache and RAM:

The cache controller is the key link between the processor, RAM and cache.

It should be noted that data caching is a complex process that uses many technologies and mathematical algorithms. Among the basic concepts used in caching, one can single out the methods of writing a cache and the architecture of cache memory associativity.

Cache Write Methods

There are two main methods for writing information to the cache:

  1. The write-back method (writeback) - data is written first to the cache, and then, upon the occurrence of certain conditions, to RAM.
  2. The write-through method (through writing) - data is written simultaneously to RAM and cache.

Cache Associativity Architecture

The cache associativity architecture defines the way in which data from RAM is mapped to the cache. There are the following main variants of caching associativity architecture:

  1. Direct-mapped cache - a specific area of ​​the cache is responsible for a specific area of ​​RAM
  2. Fully associative cache - any cache area can be associated with any RAM area
  3. Mixed cache (set-associative)

Different cache associativity architectures can typically be used at different cache levels. Direct RAM-mapped caching is the fastest caching option, so this architecture is typically used for large caches. In turn, a fully associative cache has fewer cache errors (misses).

Conclusion

In this article, you got acquainted with the concept of cache memory, cache memory architecture and caching methods, learned how it affects the performance of a modern computer. The presence of cache memory can significantly optimize the performance of the processor, reduce its idle time, and, consequently, increase the performance of the entire system.

Windows was built to be used on a maximum of machines with different configurations, and therefore it is not usually optimized for your computer and use. I also invite you to read our other articles on optimizing your computers if you have already done so. "Not optimization", it's at the processor level. Our processors have caches that allow them to put some data in memory to speed up the recovery of their data in the future: http://fr.wikipedia.org/wiki/M%C3%A9moire_cache According to processors, you can have 2 or 3 levels ( )) cache. By default, Windows uses an L2 (Level 2) cache of 256 KB, which means that if your processor can use more space, (which usually happens and will take more time given the constant evolution of processors), Windows limited the capabilities of your processor! And I don't even say no L3 cache, because Windows doesn't use it, it's like if you don't have that third cache is the largest of the 3 levels of the processor!

Its processor information:

The first thing to do is to know the capabilities of the CPU (processor), this is:

  • Download CPU-Z:-http://www.cpuid.com/softwares/cpu-z.html
  • Install it and open it
  • To see different levels of cache you have 2 options: 1 tab Bottom Right or 2

To increase the L2 cache in Windows:

  1. In the start menu, search for and open "regedit" (registry database) (as in any manipulation of the registry database, it is recommended to back up his computer in case of problems)
  2. Double click on HKEY_LOCAL_MACHINE > System > CurrentControlSet > Controls > Session Manager > Memory Management
  3. in the right window you should find a key named "SecondLevelDataCache", right click on it and click "Edit"
  4. Click the "Decimal" button
  5. And replace true with your processor. In my case, CPU - Z tells me 2 x 256, so put in my case the value 512.
  6. Click OK

To enable L3 cache on Windows:

  1. Step 1-2 is the same as L2 and so arrive at the same window in step 3.
  2. In the free zone in the right window, right click and click on "New" > "DWORD 32 bit"
  3. Rename the new key to "ThirdLevelDataCache" (no quotes)
  4. Right click on this new renamed key and click "Edit"
  5. Click the "Decimal" button
  6. Change the value that your processor is designated CPU - Z: in my case, I'm 3MBytes, so I have to do 3 x 1024, which means I have to put 3072 as the value.
  7. Click the OK button.

Restart your computer. 1 After restarting, your computer may be a little slower than usual, which from the fact that Windows needs to include this new data, but later on, your computer should be faster and more powerful! Personally, I'm not slow during reboots 1st, but I've noticed an improvement in program speed, especially at the multi-tasking level, despite the fact that I already have an SSD in my computer! Note: This trick is not overclocking and therefore there is no risk of overheating that can be found in overclocking.

One of the important factors that increase processor performance is the presence of cache memory, or rather its volume, access speed and distribution by levels.

For a long time, almost all processors are equipped with this type of memory, which once again proves the usefulness of its presence. In this article, we will talk about the structure, levels and practical purpose of cache memory, as a very important characteristic of the processor.

What is cache memory and its structure

Cache memory is an ultra-fast memory used by the processor to temporarily store data that is most frequently used. This is how, briefly, this type of memory can be described.

Cache memory is built on flip-flops, which, in turn, consist of transistors. A group of transistors takes up much more space than the same capacitors that make up RAM. This entails many difficulties in production, as well as restrictions in volumes. That is why cache memory is a very expensive memory, while having negligible volumes. But from such a structure, the main advantage of such a memory follows - speed. Since the flip-flops do not need regeneration, and the delay time of the gate on which they are assembled is small, the time for switching the flip-flop from one state to another is very fast. This allows the cache memory to operate at the same frequencies as modern processors.

Also, an important factor is the location of the cache memory. It is located on the processor chip itself, which significantly reduces the access time to it. Previously, cache memory of some levels was located outside the processor chip, on a special SRAM chip somewhere on the motherboard. Now, in almost all processors, the cache memory is located on the processor chip.

What is CPU Cache Used for?

As mentioned above, the main purpose of cache memory is to store data that is frequently used by the processor. The cache is a buffer into which data is loaded, and despite its small size (about 4-16 MB) in modern processors, it gives a significant performance boost in any application.

To better understand the need for cache memory, let's imagine the memory organization of a computer as an office. RAM will be a cabinet with folders that the accountant accesses periodically to retrieve large blocks of data (that is, folders). And the table will be the cache memory.

There are elements that are placed on the accountant's desk, which he refers to several times during the hour. For example, it can be phone numbers, some examples of documents. These types of information are right on the table, which, in turn, increases the speed of access to them.

In the same way, data can be added from those large data blocks (folders), to the table, for quick use, for example, any document. When this document is no longer needed, it is placed back in the cabinet (in RAM), thereby clearing the table (cache) and freeing this table for new documents that will be used in the next period of time.

Also with the cache memory, if there is some data that is most likely to be re-accessed, then this data from the RAM is loaded into the cache memory. Very often, this happens with the joint loading of the data that is most likely to be used after the current data. That is, there are assumptions about what will be used "after". These are the simple principles of operation.

Processor cache levels

Modern processors are equipped with a cache, which often consists of 2 or 3 levels. Of course, there are exceptions, but this is often the case.

In general, there can be such levels: L1 (first level), L2 (second level), L3 (third level). Now a little more about each of them:

The first level cache (L1) is the fastest cache memory level that works directly with the processor core, thanks to this tight interaction, this level has the shortest access time and operates at frequencies close to the processor. It is a buffer between the processor and the second level cache.

We will consider the volumes on the high performance Intel Core i7-3770K processor. This processor is equipped with 4 x 32 KB L1 cache 4 x 32 KB = 128 KB. (32 KB per core)

Second level cache (L2) - the second level is larger than the first, but as a result, it has less "speed characteristics". Accordingly, it serves as a buffer between the L1 and L3 levels. If we turn again to our Core i7-3770 K example, then here the amount of L2 cache is 4x256 KB = 1 MB.

Level 3 cache (L3) - the third level, again, slower than the previous two. But it's still much faster than RAM. The L3 cache in the i7-3770K is 8 MB. If the two previous levels are divided into each core, then this level is common to the entire processor. The indicator is quite solid, but not sky-high. Since, for example, Extreme-series processors like i7-3960X, it is 15MB, and some new Xeon processors have more than 20.

we-it.net

What is the cache for and how much is needed?

This is not about cash, but about the cache memory of processors and not only. Traders have made another commercial fetish out of the amount of cache memory, especially with the cache of central processors and hard drives (video cards also have it - but they haven't gotten to it yet). So, there is a XXX processor with a 1MB L2 cache, and exactly the same XYZ processor with a 2MB cache. Guess which one is better? Ah - don't do it right away!

Cache memory is a buffer where things that can and / or need to be put aside for later are added. The processor does the work and situations arise when intermediate data needs to be stored somewhere. Well, of course in the cache! - after all, it is orders of magnitude faster than RAM, tk. it is in the processor die itself and usually runs at the same frequency. And then, after some time, he will fetch this data back and process it again. Roughly speaking, like a potato sorter on a conveyor, which every time something other than a potato (carrot) comes across, throws it into a box. And when it's full, he gets up and carries it into the next room. At this moment, the conveyor stops and idle is observed. The volume of the box is the cache in this analogy. And how much do you need - 1MB or 12? It is clear that if its volume is small, it will take too much time to take it out and it will be simple, but from some volume its further increase will not give anything. Well, the sorter will have a box for 1000 kg of carrots - yes, he will not have so much of it for the entire shift, and this will NOT make him TWO TIMES FASTER! There is one more subtlety - a large cache can cause an increase in access delays, firstly, and at the same time, the probability of errors in it increases, for example, during overclocking - secondly. (You can read about HOW to determine the stability / instability of the processor in this case and find out that the error occurs precisely in its cache, test L1 and L2 - you can read here.) Thirdly, the cache consumes a decent area of ​​\u200b\u200bthe crystal and the transistor budget of the processor circuit. The same applies to hard drive cache memory. And if the processor architecture is strong, it will require 1024Kb of cache or more in many applications. If you have a fast HDD - 16MB or even 32MB is appropriate. But no 64MB of cache will make it faster if it's a cut called the green version (Green WD) with a speed of 5900 instead of the required 7200, even if the latter has 8MB. Then Intel and AMD processors use this cache differently (generally AMD is more efficient and their processors are often comfortable with smaller values). In addition, Intel has a shared cache, while AMD has a personal one for each core. The fastest L1 cache in AMD processors is 64Kb for data and instructions, which is twice as much as that of Intel. L3 cache is usually present in top processors like AMD Phenom II 1055T X6 Socket AM3 2.8GHz or competitor Intel Core i7-980X. First of all, games love large amounts of cache. And the cache is NOT liked by many professional applications (see below). Computer for rendering, video editing and professional applications). More precisely, the most demanding ones are generally indifferent to it. But what you definitely shouldn’t do is choose a processor by cache size. The old Pentium 4 in its latest manifestations even had 2MB of cache at operating frequencies far beyond 3GHz - compare its performance with a cheap dual-core Celeron E1 *** operating at frequencies of about 2GHz. He will not leave stone unturned from the old man. A more recent example is the high-frequency dual-core E8600 costing almost $200 (apparently because of the 6MB cache) and the Athlon II X4-620 2.6GHz, which has only 2MB. This does not prevent Athlone from butchering a competitor for a nut.

As you can see from the graphs, neither in complex programs, nor in processor-demanding games, any cache will replace additional cores. Athlon with 2MB cache (red) easily outperforms Cor2Duo with 6MB cache even at a lower frequency and nearly half the cost. Also, many people forget that the cache is present in video cards, because, generally speaking, they also have processors. A fresh example is the GTX460 video card, where they manage not only to cut the bus and the amount of memory (which the buyer will guess) - but also the shader cache, respectively, from 512Kb to 384Kb (which the buyer will NOT guess). And this will also add its negative contribution to performance. It will also be interesting to find out the dependence of performance on cache size. Let's examine how fast it grows with an increase in the cache size using the example of the same processor. As you know, processors of the E6***, E4*** and E2*** series differ only in cache size (4, 2 and 1 MB respectively). Working at the same frequency of 2400 MHz, they show the following results.

As you can see, the results are not too different. I will say more - if a processor with a capacity of 6 MB were involved - the result would increase by a little more, because. processors reach saturation. But for models with 512Kb, the drop would be noticeable. In other words, 2MB is enough even in games. Summarizing, we can draw the following conclusion - the cache is good when ALREADY there is a lot of everything else. It is naive and stupid to change the speed of the hard drive or the number of processor cores per cache size at the same cost, because even the most capacious sorting box will not replace another sorter. But there are good examples. had 1MB of cache for two cores (E2160 series and the like), and the late 45nm revision of the E5200 series still has 2MB, all other things being equal (and most importantly, PRICE). Of course, it is worth choosing the latter.

compua.com.ua

What is a cache, why is it needed and how does it work

What is the dirtiest place on a computer? Think basket? User folders? Cooling system? Didn't guess! The dirtiest place is the cache! After all, it constantly has to be cleaned!

In fact, there are many caches on a computer, and they serve not as a waste dump, but as accelerators for equipment and applications. Where does their reputation as a "systemic garbage chute" come from? Let's see what a cache is, how it happens, how it works and why it needs to be cleaned from time to time.

Cache or cache memory is a special storage of frequently used data, access to which is carried out tens, hundreds and thousands of times faster than RAM or other storage media.

Applications (web browsers, audio and video players, database editors, etc.), operating system components (thumbnail cache, DNS cache) and hardware (CPU L1-L3 cache, GPU framebuffer, etc.) have their own cache memory. chip, drive buffers). It is implemented in different ways - software and hardware.

  • The program cache is just a separate folder or file where, for example, pictures, menus, scripts, multimedia content and other content of visited sites are downloaded. This is the folder where the browser first dives when you open a web page again. Swapping a piece of content from local storage speeds up its loading and reduces network traffic.

  • In hard drives, in particular, the cache is a separate RAM chip with a capacity of 1-256 Mb, located on the electronics board. It receives information read from the magnetic layer and not yet loaded into RAM, as well as data that the operating system most often requests.

  • A modern central processor contains 2-3 main levels of cache memory (it is also called scratch memory), located in the form of hardware modules on the same chip. The fastest and smallest in volume (32-64 Kb) is cache Level 1 (L1) - it runs at the same frequency as the processor. L2 is in the middle position in terms of speed and capacity (from 128 Kb to 12 Mb). And L3 is the slowest and most voluminous (up to 40 Mb), it is absent on some models. The speed of L3 is only low relative to its faster counterparts, but it is also hundreds of times faster than the most productive RAM.

The scratchpad memory of the processor is used to store constantly used data, pumped from RAM, and machine code instructions. The larger it is, the faster the processor.

Today, three levels of caching is no longer the limit. With the advent of the Sandy Bridge architecture, Intel has implemented an additional cache L0 (intended for storing decrypted microinstructions) in its products. And the most high-performance CPUs also have a fourth-level cache, made in the form of a separate microcircuit.

Schematically, the interaction of cache L0-L3 levels looks like this (for example, Intel Xeon):

Human language about how it all works

To understand how cache memory works, imagine a person working at a desk. The folders and documents that he uses all the time are on the table (in the cache). To access them, just reach out your hand.

Papers that he needs less often are stored nearby on the shelves (in RAM). To get them, you need to get up and walk a few meters. And what a person does not currently work with has been archived (recorded on a hard disk).

The wider the table, the more documents will fit on it, which means that the employee will be able to get quick access to more information (the larger the cache capacity, the faster the program or device works in theory).

Sometimes he makes mistakes - he keeps papers on the table that contain incorrect information and uses them in his work. As a result, the quality of his work is reduced (errors in the cache lead to failures in the operation of programs and equipment). To correct the situation, the employee must discard the documents with errors and put the correct ones in their place (clear the cache memory).

The table has a limited area (cache memory has a limited capacity). Sometimes it can be expanded, for example, by moving a second table, and sometimes it cannot (the cache size can be increased if such a possibility is provided by the program; the hardware cache cannot be changed, since it is implemented in hardware).

Another way to speed up access to more documents than the table can hold is to find an assistant who will serve paper to the worker from the shelf (the operating system can allocate some of the unused RAM to cache device data). But it's still slower than taking them off the table.

Documents at hand should be relevant for current tasks. This is the responsibility of the employee himself. You need to put things in order in papers regularly (displacing irrelevant data from the cache memory falls "on the shoulders" of applications that use it; some programs have the function of automatically clearing the cache).

If an employee forgets to maintain order in the workplace and keep documentation up to date, he can draw a table cleaning schedule for himself and use it as a reminder. In extreme cases, entrust this to an assistant (if an application dependent on cache memory has become slower or often downloads outdated data, use scheduled cache cleaning tools or do this manually every few days).

We actually come across "caching functions" all over the place. This is the purchase of products for the future, and various actions that we perform in passing, at the same time, etc. In fact, this is everything that saves us from unnecessary fuss and unnecessary body movements, streamlines life and facilitates work. The computer does the same. In a word, if there was no cache, it would work hundreds and thousands of times slower. And we wouldn't like it.

f1comp.ru

Cache, cache, cash - memory. What is cache memory for? Impact of cache size and speed on performance.

Cache - memory (cache, cache, buffer - eng.) - is used in digital devices as a high-speed clipboard. Cache memory can be found on such computer devices as hard drives, processors, video cards, network cards, CD drives, and many others.

The principle of operation and architecture of the cache can be very different.

For example, the cache can serve as a regular clipboard. The device processes the data and transfers it to a high-speed buffer, where the controller transfers the data to the interface. Such a cache is intended to prevent errors, hardware check data for integrity, or to encode the signal from the device into an understandable signal for the interface, without delays. Such a system is used, for example, in CD / DVD drives of compact discs.

In another case, the cache can be used to store frequently used code and thus speed up data processing. That is, the device does not need to recompute or look up the data, which would take much longer than reading it from the cache. In this case, the size and speed of the cache plays a very important role.


This architecture is most commonly found on hard drives, SSDs, and central processing units (CPUs).

When devices are running, special firmware or dispatcher programs can be loaded into the cache, which would work slower with ROM (Read Only Memory).

Most modern devices use a mixed type of cache, which can serve as both a clipboard and for storing frequently used code.

There are several very important functions implemented for the cache of processors and video chips.

Consolidation of execution units. CPUs and video processors often use a fast shared cache between cores. Accordingly, if one core processed the information and it is in the cache, and a command arrives for the same operation, or for working with this data, then the data will not be processed by the processor again, but will be taken from the cache for further processing. The kernel will be offloaded to process other data. This significantly increases performance in the same type, but complex calculations, especially if the cache is large and fast.

The shared cache also allows cores to work with it directly, bypassing slow RAM.

Cache for instructions. There is either a general very fast first-level cache for instructions and other operations, or a dedicated one for them. The more embedded instructions a processor has, the larger the instruction cache it needs. This reduces memory latency and allows the instruction block to function almost independently.

Other functions and features.

It is noteworthy that in CPUs (central processing units), hardware error correction (ECC) is used, because a small error in the cache can lead to one continuous error in further processing of this data.

In the CPU and GPU, there is a cache memory hierarchy that allows you to separate data for individual cores and general ones. Although almost all data from the second level cache is still copied to the third, general level, but not always. The first cache level is the fastest, and each subsequent one is slower, but larger in size.

For processors, three or fewer cache levels are considered normal. This allows you to achieve a balance between speed, cache size and heat dissipation. It is difficult to find more than two levels of cache in video processors.

Cache size, performance impact and other characteristics.

Naturally, the larger the cache, the more data it can store and process, but there is a serious problem here.

Big cache means big transistor budget. In server processors (CPUs), the cache can use up to 80% of the transistor budget. Firstly, this affects the final cost, and secondly, power consumption and heat dissipation increase, which is not comparable with a performance increased by several percent.

One of the most important characteristics of a processor is its cache memory. Not only its volume is important, but also the speed of access, as well as its distribution by levels. Absolutely all desktop processors and even some mobile ones are equipped with this memory. In this part, we will talk about the practical purpose of this characteristic.

Structure and what the cache is for

Cache- This is a memory that has a high read / write speed and is designed to temporarily store the most used data. Translating into simple language, it serves to speed up the processor when performing tasks of the same type.

Another name for cache memory is static memory., its important feature is the construction of each of its cells on a transistor cascade (i.e. one cell looks like a group of transistors), each cascade contains on average up to 10 transistors. Since the switching speed of the transistor between states is extremely high, the speed of the memory is very high. But there is also a negative point, it lies in the overall dimensions of this type of memory, as well as its high cost.

The first owners of this type of cache memory were Intel 80386 (386th) processors and it was located on the motherboard. In the future, on newer Intel 80486 (486th) processors, this type of memory was added to the processor die itself, while retaining it on the motherboard. According to this feature, they were divided into two levels, what is on the chip itself became known as the first-level cache (L1), and the one on the motherboard - the second-level cache (L2). But in our time, the second level cache has also been transferred to the processor die. Between themselves, these types of memory work according to two possible schemes: inclusive (duplication of memory in both levels) and exclusive (data at each level are exclusive).

As mentioned earlier, cache memory serves as a buffer into which frequently executed commands and used data are loaded from RAM (Random Access Memory). Although its size is extremely small by today's standards (up to 32 MB), it provides a significant performance boost. The connection between cache memory and RAM occurs according to one of the possible schemes: direct mapping, type-associative, associative. It makes no sense to explain these circuits, I doubt that when buying, someone will be able to answer you which circuit is used in a particular processor.

Processor cache levels

Most modern processors are equipped with two or three levels of cache memory (now the third can be located on the motherboard):

First level cache(L1)- the fastest of all levels, located in close proximity to the processor core, due to which it has the shortest response time and operates at a speed close to the speed of the processor. Another function of this type of memory is to provide an exchange between the processor and the second level of cache memory.

Second level cache(L2)- has more memory than the first, but this results in such a negative moment as a decrease in speed. It can be either general for the entire processor or individual for each core. One of the purposes is a buffer between the first and third levels.

L3 Cache (L3)- the slowest of the caches (but still significantly faster than RAM), but also has the largest amount of memory. If the first level is individual for each core, then this one is common to the entire processor.

Summing up

The processor's cache is its personal ultra-fast RAM. It serves to store the most frequently used data by the processor when performing a particular task. There can be three levels of processor cache memory - the fastest is the first level, and the largest, but also the slowest, is the third.

Top Related Articles