1. What Exactly Is Computer Performance?
When we say a computer has good performance, we usually mean it can complete tasks faster, respond to operations more smoothly, and remain stable under high load.
But different tasks place different demands on computer hardware.
For example:
- Opening a web page: involves the CPU, memory, network, and storage.
- Video editing: involves the CPU, memory, GPU, and high-speed storage.
- Running large games: involves the CPU, GPU, memory, and VRAM.
- Compiling a large project: involves the CPU, memory, and random read/write on storage.
- Running a database: involves the CPU, memory capacity, storage IOPS, and latency.
- Running a large AI model: involves the CPU, GPU, memory, VRAM, and storage bandwidth.
Therefore, we cannot simply assume that the higher the CPU frequency, the better the computer's performance will necessarily be.
The overall performance of a computer depends on whether multiple hardware components can work together effectively.
1. Several Core Metrics of Computer Performance
| Metric | Meaning | Typical Influencing Factors |
|---|---|---|
| Response Time (Latency) | How long it takes to complete one operation | CPU, memory, and storage latency |
| Throughput | How many tasks are completed per unit of time | Number of CPU cores, parallelism, bandwidth |
| Bandwidth | How much data can be transmitted per unit of time | Memory, bus, storage interfaces |
| IOPS | How many I/O operations a storage device completes per second | SSD controller, media, queue depth |
| Concurrency | How many tasks can be handled at the same time | CPU, memory, scheduling mechanisms |
| Stability | Whether performance can be maintained under prolonged load | Cooling, power supply, hardware reliability |
These metrics are not equivalent to one another.
For example:
- Low latency does not necessarily mean high throughput.
- Large bandwidth does not mean every access is fast.
- Many CPU cores do not mean a single task executes faster.
- High sequential read/write speed on an SSD does not mean random access is equally excellent.
2. The Overall Structure of Computer Performance
A computer can be understood as a system working in coordination:
flowchart TD
A["User Task"] --> B["Operating System and Applications"]
B --> C["CPU: executes instructions and performs computation"]
C <--> D["Memory: holds running data"]
D <--> E["Storage: holds programs and files"]
C <--> F["GPU: parallel computing and graphics processing"]
F <--> D
E --> D
C --> G["Bus and Interconnect: transmits data"]
D --> G
F --> G
G --> H["Completes the task and returns the result"]
style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style B fill:#F1EAF8,stroke:#C7B2DF,color:#59446E
style C fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style D fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style E fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style F fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style G fill:#F6FAF7,stroke:#DCE9E0,color:#334155
style H fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
Among these, the CPU, memory, and storage are the three most fundamental components for understanding computer performance.
2. CPU: Determines the Computer's Computing Capability
The CPU (Central Processing Unit) is the core computing component of a computer.
It is responsible for executing program instructions, processing data, performing logical judgments, and coordinating the various operations within the computer.
If we compare a computer to a factory:
- The CPU is the worker responsible for carrying out tasks.
- Memory is the workbench the worker uses at hand.
- Storage devices are the warehouse that holds raw materials and finished products.
The CPU determines the computer's ability to process instructions and perform computations, but it cannot complete all tasks on its own.
1. How Does the CPU Execute a Program?
A program is essentially composed of a series of machine instructions.
When the CPU executes a program, it must continuously fetch instructions, decode instructions, and execute instructions.
A typical instruction execution process can be summarized as:
- Fetch.
- Decode.
- Execute.
- Memory Access.
- Write Back.
Modern CPUs typically employ techniques such as pipelining, out-of-order execution, and branch prediction, allowing multiple instruction stages to overlap.
flowchart TD
A["Program instructions"] --> B["Instruction Fetch"]
B --> C["Instruction Decode"]
C --> D["Execute"]
D --> E["Memory Access"]
E --> F["Write Back Result"]
F --> G{"Is there another instruction?"}
G -->|Yes| B
G -->|No| H["Program execution complete"]
style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style B fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style C fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style D fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style F fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style G fill:#F1EAF8,stroke:#C7B2DF,color:#59446E
style H fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
CPU performance depends not only on how fast instructions are executed, but also on whether instructions can continuously obtain data.
If the CPU is fast but frequently has to wait for memory or storage devices to provide data, its compute resources cannot be fully utilized.
2. CPU Clock Speed: How many clock cycles can be executed per second?
CPU clock speed (Clock Speed) refers to the frequency at which the processor clock runs.
For example:
- 2.5 GHz: approximately 2.5 billion clock cycles per second.
- 3.5 GHz: approximately 3.5 billion clock cycles per second.
- 5.0 GHz: approximately 5.0 billion clock cycles per second.
The higher the clock frequency, the more execution cycles the CPU can usually complete in the same amount of time.
But note:
One clock cycle is not equal to executing one instruction.
Different instructions have different execution costs. One instruction may require multiple cycles, or through pipelining and out-of-order execution mechanisms, parts of multiple instructions may be completed within one cycle.
Therefore, clock speed alone cannot determine CPU performance.
3. IPC: How many instructions can the CPU complete per cycle?
IPC (Instructions Per Cycle) indicates the average number of instructions the CPU completes per clock cycle.
A simplified performance relationship is:
For example:
| CPU | Clock Speed | IPC | Theoretical instruction throughput |
|---|---|---|---|
| A | 3.0 GHz | 2.0 | 6.0 GIPS |
| B | 4.0 GHz | 1.5 | 6.0 GIPS |
| C | 4.0 GHz | 2.5 | 10.0 GIPS |
Here, GIPS refers to the order of magnitude of billions of instructions per second.
The above is only a simplified model for understanding. Real processor performance is also affected by factors such as instruction types, branch prediction, cache hit rate, execution ports, power consumption, and memory latency.
This also explains why a new-generation CPU may deliver better performance even if its clock speed has not increased significantly.
4. Number of CPU Cores: Processing multiple tasks simultaneously
A CPU core (Core) is a processing unit capable of independently executing an instruction stream.
For example:
- Dual-core CPU: 2 physical cores.
- Quad-core CPU: 4 physical cores.
- Eight-core CPU: 8 physical cores.
- Sixteen-core CPU: 16 physical cores.
Multiple cores can execute tasks from different threads simultaneously.
For example:
Core 1: Run browser
Core 2: Run music player
Core 3: Compile code
Core 4: Handle background system tasks
Increasing the number of cores usually helps improve the throughput of multithreaded tasks.
However, if a program can only use one thread, increasing the number of CPU cores may not significantly improve its execution speed.
Therefore:
- Single-threaded tasks place more emphasis on single-core performance.
- Multithreaded tasks place more emphasis on multi-core performance.
- High-concurrency services place more emphasis on overall throughput and scheduling capability.
5. CPU Cache: Why doesn't the CPU access memory directly?
The CPU's computing speed is much higher than that of DRAM.
If every computation required accessing memory, the CPU could spend a large amount of time waiting for data.
To solve this problem, multiple levels of cache (Cache) are designed into the CPU.
Common cache structures include:
| Cache | Characteristics |
|---|---|
| L1 Cache | Smaller capacity, fastest, usually independent per core |
| L2 Cache | Larger capacity, slightly slower |
| L3 Cache | Usually larger capacity, possibly shared by multiple cores |
When the CPU accesses data, it checks the cache first.
If the data is in the cache, it can be obtained quickly; if there is a cache miss, the data must be fetched from a lower level.
The higher the cache hit rate, the less time the CPU usually spends waiting for data.
For example:
Suppose a program frequently accesses an array. If the array makes good use of the cache, it may achieve very high execution efficiency.
Conversely, if a program keeps accessing data scattered throughout memory, it may cause many cache misses.
flowchart TD
A["CPU needs to read data"] --> B["Check L1 Cache"]
B --> C{"L1 hit?"}
C -->|Yes| D["Return data directly"]
C -->|No| E["Check L2 Cache"]
E --> F{"L2 hit?"}
F -->|Yes| G["Return data and update cache"]
F -->|No| H["Check L3 Cache"]
H --> I{"L3 hit?"}
I -->|Yes| J["Return data and update cache"]
I -->|No| K["Access DRAM"]
K --> L["Return data and fill cache"]
L --> D
style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style B fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style C fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style D fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style E fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style F fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style G fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style H fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style I fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style J fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style K fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style L fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
6. What other factors affect CPU performance?
Besides clock speed, core count, and cache, CPU performance is also affected by the following factors:
| Factor | Impact |
|---|---|
| Microarchitecture | Determines instruction execution, scheduling, and pipeline efficiency |
| IPC | Affects the ability to complete instructions per clock cycle |
| Branch prediction | Reduces pipeline stalls caused by conditional branches |
| Out-of-order execution | Improves execution unit utilization |
| SIMD instructions | Improves vector and batch data processing efficiency |
| Process node and power consumption | Affects power consumption, heat generation, and operating frequency |
| Cooling capability | Determines whether performance can be sustained under continuous load |
| Memory controller | Affects the CPU's ability to retrieve data from memory |
Therefore, CPU performance should be considered comprehensively, rather than just looking at the GHz number after the model name.
III. Memory: Determines How Much Data the Computer Can Process Simultaneously
Memory usually refers to the computer's main memory, namely DRAM.
It is responsible for storing running programs and their data.
When the CPU executes a program, it needs to continuously read instructions and data from memory and write computation results back to memory.
Memory capacity and speed directly affect the computer's operating experience.
1. Why is memory needed?
Suppose we open a browser.
The operating system needs to load the browser program's code and related data into memory.
After the browser starts running, it also needs to keep the following in memory:
- Currently open web pages.
- Page images and videos.
- JavaScript runtime environment.
- Browser tab states.
- Page cache.
- Extensions and background tasks.
If memory capacity is insufficient, the system cannot keep all active data in physical memory at the same time.
In this case, the operating system may need to use storage devices as backing space for virtual memory.
This usually leads to decreased performance.
2. Memory Capacity: Determines How Much Running Data Can Be Held
Memory capacity is usually measured in GB.
Common configurations include:
- 8GB.
- 16GB.
- 32GB.
- 64GB.
- 128GB.
Different usage scenarios have different memory capacity requirements.
| Use case | Common capacity reference |
|---|---|
| Everyday office work, light browsing | 8GB–16GB |
| Multi-tab browsing, general development | 16GB–32GB |
| Large development projects, virtual machines | 32GB–64GB |
| Video editing, professional creative work | 32GB–64GB or higher |
| Data analysis, complex workloads | 64GB or higher |
| Large in-memory databases | Configured according to data scale |
These are only common reference ranges; actual requirements also depend on the software, project scale, dataset size, and level of concurrency.
3. What Happens When Memory Capacity Is Insufficient?
When physical memory is insufficient, the operating system needs to reclaim some memory or swap temporarily inactive data out to disk.
Windows has a page file (Pagefile).
Linux has a Swap partition or Swap file.
These mechanisms are all part of the virtual memory management system.
It is important to note:
Virtual memory is not equal to physical memory.
It is a memory management abstraction provided by the operating system, including mechanisms such as address space, page tables, physical page management, and, when necessary, using disk as backing storage.
When the system pages frequently, even though an SSD is much faster than a mechanical hard drive, it usually cannot replace DRAM's low-latency access capability.
4. Memory Frequency and Bandwidth
In addition to capacity, memory also has frequency and bandwidth.
Memory bandwidth indicates the amount of data that can be transferred per unit time.
A simplified theoretical bandwidth calculation formula is:
For example, suppose a DDR5 memory module has a data transfer rate of 5600 MT/s and a data bus width of 64 bit:
This means the theoretical bandwidth of a single channel is approximately 44.8 GB/s.
With a dual-channel configuration, the theoretical total bandwidth can be further increased to approximately 89.6 GB/s.
Actual bandwidth is also affected by factors such as the memory controller, timings, load, and platform implementation.
5. What Is the Difference Between MT/s and MHz?
Numbers such as 5600 and 6000 often appear in memory specifications.
These numbers usually represent MT/s, i.e., millions of data transfers per second.
DDR stands for Double Data Rate, meaning data is transferred on both edges of a clock cycle.
Therefore:
- MHz represents clock frequency.
- MT/s represents the number of data transfers per second.
The two are not exactly the same unit.
For example, a DDR memory data transfer rate of 6000 MT/s does not mean its actual clock frequency is 6000 MHz.
6. Memory Latency: When Does the Data Arrive?
In addition to bandwidth, memory latency is also important.
Common memory timing parameters include:
- CL: CAS Latency.
- tRCD: RAS to CAS Delay.
- tRP: Row Precharge Time.
- tRAS: Row Active Time.
For example:
DDR5-6000 CL30
Where:
- 6000 indicates a data transfer rate of approximately 6000 MT/s.
- CL30 indicates a CAS Latency of 30 memory clock cycles.
For DDR memory, the actual clock frequency is usually half the data transfer rate.
Therefore, the theoretical CAS time corresponding to CL30 is approximately:
This is only the CAS latency; it is not equal to the total latency of a complete memory access.
An actual access may also involve processes such as row activation, precharge, controller queuing, and data transfer.
7. Differences Among Memory Capacity, Bandwidth, and Latency
| Metric | What It Mainly Determines | Typical Symptoms When Insufficient |
|---|---|---|
| Capacity | How much running data it can hold simultaneously | Memory pressure, paging, stuttering |
| Bandwidth | How much data can be transferred per unit time | Slower large-scale data processing |
| Latency | How long it takes to retrieve data | Slower tasks sensitive to random access and dependency chains |
| Number of channels | Data transfer channels available for parallel use | Bandwidth may be limited |
| Timings | Wait cycles for internal memory operations | Affects access latency and actual performance |
It cannot simply be assumed that the higher the frequency, the faster all programs will be.
For tasks involving large amounts of sequential data transfer, bandwidth may be more important.
For tasks involving large amounts of random access, latency may be more critical.
IV. Storage Devices: Determining the Speed of Data Reading and Saving
Storage devices are responsible for long-term storage of operating systems, applications, files, and databases.
Unlike memory, storage devices are usually non-volatile.
Data is retained even when the computer loses power.
Common storage devices include:
- HDD: Hard disk drive.
- SATA SSD: Solid-state drive using a SATA interface.
- NVMe SSD: Solid-state drive connected via PCIe lanes.
1. HDD: Hard Disk Drive
Hard disk drives use magnetic platters to store data.
They usually consist of the following parts:
- Magnetic platters.
- Spindle motor.
- Read/write heads.
- Actuator.
- Control circuitry.
When reading data, a hard drive needs to spin up the platters and move the read/write head to the target position.
As a result, the access latency of a mechanical hard drive is affected by seek time and rotational latency.
Its characteristics are:
- Large capacity.
- Lower cost per unit of capacity.
- Higher random access latency.
- Relatively weaker resistance to vibration and shock.
- Well suited to storing large numbers of files and archival storage.
2. SSD: Solid-State Drive
SSDs use NAND Flash memory to store data.
They do not have the spinning platters and moving heads found in traditional mechanical hard drives.
An SSD typically contains:
- NAND Flash chips.
- An SSD controller.
- A cache or buffering mechanism.
- Firmware.
- A host interface.
The SSD controller is responsible for tasks such as managing data reads and writes, address mapping, garbage collection, and wear leveling.
3. SATA SSDs and NVMe SSDs
The main difference between SATA SSDs and NVMe SSDs is not just the storage medium, but more importantly the interface and communication protocol.
| Comparison Dimension | SATA SSD | NVMe SSD |
|---|---|---|
| Host interface | SATA | PCIe |
| Communication protocol | AHCI | NVMe |
| Typical connection method | SATA data interface | PCIe lanes, commonly in the M.2 form factor |
| Queue capability | Relatively limited | Supports large numbers of queues and commands |
| Latency | Usually higher | Usually lower |
| Bandwidth | Limited by SATA 6Gb/s | Increases with PCIe generation and lane count |
Note:
M.2 is a physical specification and interface form factor, and is not the same thing as NVMe.
An M.2 SSD may use the SATA protocol or the PCIe/NVMe protocol.
4. Why are SSDs faster than mechanical hard drives?
When a mechanical hard drive reads random data, it needs to move the head and wait for the platter to rotate.
An SSD, by contrast, can access data in NAND Flash through the flash controller, without mechanical seeking.
As a result, SSDs generally have a clear advantage in random reads and writes.
For example:
| Storage Device | Typical Access Characteristics |
|---|---|
| HDD | Random access latency is typically on the order of milliseconds |
| SATA SSD | Random access latency is typically on the order of microseconds |
| NVMe SSD | Typically has lower access latency and higher parallelism |
Actual performance depends on the device model, access pattern, queue depth, data block size, and load conditions.
5. Key Storage Performance Metrics
| Metric | Meaning |
|---|---|
| Sequential read speed | The speed of continuously reading large amounts of data |
| Sequential write speed | The speed of continuously writing large amounts of data |
| Random read speed | The ability to read scattered data |
| Random write speed | The ability to write scattered data |
| IOPS | The number of input/output operations completed per second |
| Latency | The time required for a single I/O operation |
| Queue depth | The number of I/O requests waiting to be processed at the same time |
For example:
Copying a large file of several tens of GB is mainly affected by sequential read and write capability.
Opening a project that contains a large number of small files may depend more on random read performance and the file system's metadata access capability.
So, the fact that an SSD has a high rated sequential read speed does not mean that all operations will be equally fast.
V. How Do the CPU, Memory, and Storage Work Together?
We have introduced the CPU, memory, and storage separately above.
But when a computer runs a program, they do not work in isolation.
They need to work together through a series of data transfer and management mechanisms to complete tasks.
1. What Happens When You Open a Program?
Take opening an application as an example.
The application is initially stored on an SSD or HDD.
The operating system needs to read the program files from the storage device and map the relevant content into the process's virtual address space.
When the program actually accesses certain pages, the operating system prepares the corresponding physical pages through the memory management mechanism.
The CPU then executes the program instructions and continuously accesses code and data in memory.
The whole process can be summarized as:
flowchart TD
A["User starts the application"] --> B["Operating system creates a process"]
B --> C["Accesses application files"]
C --> D["Storage device reads program data"]
D --> E["Establishes virtual memory mapping"]
E --> F["Loads or prepares physical pages on demand"]
F --> G["CPU fetches instructions and data"]
G --> H["CPU executes the program"]
H --> I["Accesses runtime data in memory"]
I --> J["Produces computation results"]
J --> K["Writes to storage device when necessary"]
style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style B fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style C fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style D fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style F fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style G fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style H fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style I fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style J fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style K fill:#F1EAF8,stroke:#C7B2DF,color:#59446E
There is an important detail here:
A program does not necessarily need to copy the entire file into memory at startup.
Modern operating systems usually use virtual memory and demand paging mechanisms.
When a program accesses a page that is not yet resident in memory, it may trigger a page fault, and the operating system is responsible for preparing the corresponding page.
A page fault does not necessarily mean the program has an error.
It may also be normal demand-loading behavior.
2. How does the CPU fetch data from memory?
The CPU does not fetch every instruction directly from the SSD.
The usual data access hierarchy is:
CPU
↓
L1 Cache
↓
L2 Cache
↓
L3 Cache
↓
DRAM
↓
SSD / HDD
Different levels have different capacity, speed, and cost.
| Level | Capacity characteristics | Access speed characteristics | Main role |
|---|---|---|---|
| CPU registers | Extremely small | Extremely fast | Stores current computation operands |
| L1 Cache | Very small | Extremely fast | Caches frequently used data |
| L2 Cache | Relatively small | Very fast | Caches more data |
| L3 Cache | Relatively large | Relatively fast | Relieves memory-access pressure on cores |
| DRAM | Commonly GB-scale | Sub-microsecond scale | Stores program runtime data |
| SSD | Commonly hundreds of GB to several TB | Usually much slower than DRAM | Long-term data storage |
| HDD | Commonly TB-scale | Higher random-access latency | High-capacity storage |
The speeds in the table only indicate rough levels; actual latency varies with hardware architecture and access method.
3. Why are both memory and storage devices needed?
Some might ask:
Since SSDs can store data, why not just use SSDs instead of memory?
The reason is that their design goals are different.
Memory mainly aims for:
- Low access latency.
- Frequent random reads and writes.
- Direct cooperation with the CPU memory controller.
- Efficient support for data access while programs run.
Storage devices mainly aim for:
- Non-volatility.
- Large capacity.
- Long-term data retention.
- Lower cost per unit capacity.
Even though high-performance NVMe SSDs have very high sequential read speeds, their random-access latency and access mechanisms are still different from those of DRAM.
Therefore, SSDs cannot directly replace DRAM.
4. The essence of how the three work together
It can be summarized in one sentence:
- The CPU handles computation.
- Memory provides the data currently in use.
- Storage keeps programs and data for the long term.
The efficiency of collaboration among the three determines whether a program can continuously and stably obtain the resources it needs.
6. How does data flow between the CPU, memory, and storage?
While a computer is running, data needs to move constantly between different hardware components.
These transfers are affected by mechanisms such as buses, memory controllers, I/O controllers, and DMA.
1. Data transfer requires channels
The CPU, memory, and storage devices cannot exchange data out of thin air.
They need to communicate through hardware interconnects and controllers.
Common technologies include:
- Memory bus.
- PCI Express (PCIe).
- SATA.
- USB.
- Chipset interconnect.
- Memory controller.
Different devices connect to the system through different interfaces.
2. Memory Controller
The memory controller is responsible for coordinating data access between the CPU and DRAM.
Modern processors usually integrate the memory controller into the CPU.
It is responsible for:
- Handling memory read/write requests.
- Managing memory channels.
- Controlling DRAM timing.
- Coordinating memory refresh.
- Scheduling memory accesses.
If the CPU needs to access DRAM, the relevant requests must go through the memory controller.
3. PCIe and NVMe
Modern NVMe SSDs are usually connected via PCIe.
PCIe is a high-speed serial interconnect technology that can provide data transfer channels for devices such as SSDs, GPUs, and network cards.
PCIe bandwidth is affected by the following factors:
- PCIe generation.
- Number of lanes.
- Encoding efficiency.
- Device controller capabilities.
- Support from the motherboard and CPU platform.
For example, there is a clear difference in theoretical bandwidth between PCIe 4.0 x4 and PCIe 5.0 x4.
However, actual SSD performance is also limited by factors such as NAND flash speed, controller, and cooling.
4. DMA: How Do Devices Transfer Data Directly?
DMA (Direct Memory Access) allows devices with the appropriate capabilities, with the support of DMA control mechanisms, to transfer data directly to memory, reducing the burden on the CPU of moving every byte of data.
For example, when an SSD reads data, the device can write the data into a buffer in memory through the DMA mechanism.
The CPU is mainly responsible for:
- Creating and submitting I/O requests.
- Setting up the relevant buffers and DMA mappings.
- Configuring the necessary queues.
- Handling completion notifications.
- Continuing to process the data.
In modern systems, DMA usually also requires mechanisms such as an IOMMU to provide address translation and access isolation.
5. Typical NVMe Read/Write Process
flowchart TD
A["Application requests file read"] --> B["Operating system filesystem processes request"]
B --> C["Block device layer generates I/O request"]
C --> D["NVMe driver submits command"]
D --> E["NVMe controller receives command"]
E --> F["Controller reads NAND data"]
F --> G["Transfer to memory via DMA"]
G --> H["Controller updates completion queue"]
H --> I["CPU handles completion notification"]
I --> J["Data delivered to application"]
style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style B fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style C fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style D fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
style F fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style G fill:#DCEFE5,stroke:#8EBFA5,color:#24563F
style H fill:#E9E4FA,stroke:#B7A5E0,color:#493B70
style I fill:#FFF2D8,stroke:#E8C98A,color:#76551F
style J fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
This is a simplified NVMe read model; actual implementations also involve mechanisms such as the operating system page cache, I/O scheduling, queue management, and interrupts or polling.