Equality of computer CPU and peripherals-DMA Overview

Source: Internet
Author: User
Tags prefetch
I always think that there is nothing special about the CPU inside a computer. Like disks and NICs, it is a kind of device. They are connected to the bus together and have a certain degree of intelligence, however, this argument is only macro-level. The intelligence of the CPU is higher than that of other peripherals. Is that true? In fact, this is really a bad habit of CPU, and although they are all connected to the bus, but the bus is also very different, not as ideal to connect to a line, these hybrid and fine-grained features make people think that CPU is the center, while peripherals are only affiliated. When you understand DMA, you may have different ideas, because the DMA controller can allow peripherals to directly access the memory. Is this because peripherals are more like CPUs, according to the CPU center theory, only the CPU can access the memory, and Peripherals can only access the memory through the CPU. In fact, no device can access the memory not only by the CPU, the most important thing is to compete for the total access memory
Line. Generally, the execution process of a computer is that the CPU obtains the command to be executed from the memory and then executes the command according to the hardware logic inside the CPU. This includes the command queue, prefetch, and branch prediction mechanisms, then, the CPU will save some data to the memory and may also read data from the memory. It seems that the memory is dedicated to the CPU and serves as a peripherals, they can only passively accept CPU reads from memory and then sends them
They can't take or even prefetch commands like the CPU. When there is data to be read on them, they must interrupt the CPU and then read the data to the memory through the CPU, the CPU can only help peripherals transmit data. Who is benefiting from this inequality, CPU? Does CPU compete against us in this way? Does it have to compete for the overlord of the main board? Yes, it is, and then let's see if this officer is good or not. The CPU cannot concentrate on its own business, and the network card will be used from time to time, disks and other peripherals that are supposed to be equal, interrupt them, or help them transmit data from memory from time to time. This is the cost of sub-accounts. In fact, the CPU is very much equal, this architecture is also more harmonious, but the human nature-the desire to govern is injected into the computer design, which eventually leads to the CPU center theory. According to the simple design idea, it is also obvious that whoever gets to the bus can walk. After all, walking is normal at the foot of the road. When competing for the bus, there is no need for anyone to give up and those who want to get the bus. However, to achieve multi-lane parallel, even two-way multi-lane. According to the simple design, the computer system is a path for several organs. The organs cooperate with each other to serve the people and share the road. Memory is a warehouse. Anyone can access things, as long as the processing is complete.
Conflict can be solved. In fact, it is very simple, that is, Road Occupation. At the same time, only one agency's proxy can control a one-way, one-lane road. If two-way, Multiple lanes are achieved, then you must implement concurrent conflict processing in the memory warehouse. Fortunately, this model already exists, that is, DMA. Peripherals can directly access the memory without the help of the CPU, so as to achieve better video and audio effects, because the dual-pass operator saves the CPU, the efficiency is always higher. In addition, the device can direct internal access and set prefetch. This is very good for the video card, the graphics card can achieve complex processing like the CPU. In fact, GPU has exceeded the CPU in some fields. GPU is just the beginning of the peripherals revolution. In the end, I believe that, the Republican government will surely become a reality in computer systems. The previous peripheral commands were sent from the CPU.
And then the peripherals are passively executed, so that the commands that can be executed by the peripherals will be restricted to limit the functions and performance of the peripherals. For example, even if the peripherals want to do this or do this, they need the cooperation of the two commands, however, the CPU does not send commands to peripherals, And the peripherals want to be passive and autonomous. After the DMA implementation, the peripherals can be directed by themselves, so that the peripherals can implement more complex logic, an example unrelated to DMA is SISC's TCQ mechanism, which can implement complex command queues to achieve efficient low-level disk scheduling. If the DMA feature is applied, this TCQ will be used more efficiently and simply. From a simple point of view, the concept of connection DMA is that the CPU is just a DMA device, but the current system implementation, it is always a long time to occupy the bus.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.