CN104239249A - PCI-E (peripheral component interconnect-express) zero-copy DMA (direct memory access) data transmission method - Google Patents
PCI-E (peripheral component interconnect-express) zero-copy DMA (direct memory access) data transmission method Download PDFInfo
- Publication number
- CN104239249A CN104239249A CN201410472223.8A CN201410472223A CN104239249A CN 104239249 A CN104239249 A CN 104239249A CN 201410472223 A CN201410472223 A CN 201410472223A CN 104239249 A CN104239249 A CN 104239249A
- Authority
- CN
- China
- Prior art keywords
- data
- memory
- pci
- object system
- data transmission
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Abstract
The invention provides a PCI-E (peripheral component interconnect-express) zero-copy DMA (direct memory access) data transmission method and belongs to the technical field of PCI-E data transmission. The method comprises the following steps: firstly allocating physical memory with a proper size to a data source system and the physical memory with the proper size to a data destination system, and respectively establishing an idle memory pool and a working memory pool for the allocated physical memory in the data source system and the allocated physical memory in the data destination system through a double linked list; directly performing data filling after acquiring idle memory from the idle memory pool when data transmission is performed between user application programs in the data source system, and transmitting data to the data destination system after the data filling; storing the received data into the working memory pool in the data destination system, and acquiring the data for use from the working memory pool by the user application programs by using corresponding APIs (application program interfaces); returning the corresponding memory to the idle memory pool after the use. According to the PCI-E zero-copy DMA data transmission method provided by the invention, the pressure of a CPU (central processing unit) is greatly relieved; system call is reduced; the switchover of user kernel space is relived for large-scale and small-data volume transmission, and the system efficiency is improved.
Description
Technical field
The present invention relates to PCI-E technical field of data transmission, specifically a kind of DMA data transmission method of zero-copy.
Background technology
Traditional PCI-E data transmission method adopts DMA (Direct Memory Access, direct memory access).Concrete grammar all needs distribution one piece of continuous print physical memory in data source and data object system, before starting, in data source systems, user application is responsible for a data copy in physical memory, be responsible for data to transfer to the physical memory of data object system from data source physical memory by dma controller during DMA transmission, in data object system, be copied to user's space by application program after DMA terminates to use, then former 2 pieces of physical memories can do data transmission next time.Fig. 1 is traditional data transmission method schematic diagram:
Step 1) data source systems: user application is in physical memory in data copy to kernel spacing;
Step 2) DMA;
Step 3) data object system: user application is copied to user's space data physical memory from kernel spacing and uses.
The method in the system of data source and data object, amounts to generation 2 memory copyings (step 1 and step 3, except DMA) and 4 subsystems call in data transmission procedure, and inefficiency, adds unnecessary burden to CPU.
Summary of the invention
The object of the invention is the data transmission efficiency in order to improve PCI-E, alleviating CPU pressure, propose a kind of PCI-E zero-copy DMA data transmission method.
PCI-E zero-copy DMA data transmission method provided by the invention, specifically:
Step one, in data source systems and data object system, distribute separately the physical memory of N block size, use doubly linked list to set up available memory pool and working memory pond to the N block physical memory in data source systems and data object system respectively;
During the user application transmission data of step 2, data source systems, corresponding api interface is used to obtain one piece of idle internal memory from the available memory pool of data source systems;
The user application of step 3, data source systems directly by data stuffing in acquired internal memory;
After step 4, data stuffing are complete, use corresponding API to transfer data to data object system, and leave the working memory pond of data object system in;
The user application of step 5, data object system uses corresponding api interface from the working memory pond of data object system, obtain the next data of transmission, after data are finished using, the internal memory used in data source systems and data object system is returned to available memory pool.
Advantage of the present invention and good effect are: (1) deletes 2 unnecessary memory copyings, dramatically reduces the pressure of CPU; (2) decrease 4 subsystems to call, the transmission for extensive small data quantity alleviates the switching of user's kernel spacing, improves system effectiveness; (3) have employed the mode that POLLING+ interrupts, decrease the number of processes of system break, in once interrupting, more data volume must processed as far as possible.
Accompanying drawing explanation
Fig. 1 is traditional data transmission method schematic diagram;
Fig. 2 is Zero-copy data transmission method schematic diagram of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
The object of the invention is the data transmission efficiency in order to improve PCI-E, alleviating CPU pressure, propose a kind of data transmission method of zero-copy.
As shown in Figure 2, PCI-E zero-copy DMA data transmission method provided by the invention, specifically comprises the following steps:
Step one, in data source and data object system, distribute separately the physical memory of the suitable size of N block, use doubly linked list to set up available memory pool and working memory pond to the N block physical memory in data source and data object system respectively.Mmap in Fig. 2 refers to doubly linked list.
In data source systems, distribute N block physical memory, in data object system, distribute N block physical memory, the size of N is set by the user as required.Respectively available memory pool and working memory pond are set up to the N block physical memory in the N block physical memory of data source systems and data object system.Described available memory pool comprises physical memory available free in N block physical memory, and described working memory pond comprises the physical memory used in N block physical memory.
Step 2, the user application of data source systems need transmission data time, corresponding API (Application Programming Interface, application programming interface) is used to obtain one piece of idle internal memory from the available memory pool of data source.
The user application of step 3, data source systems can this block internal memory of direct control, by data stuffing in acquired internal memory.Directly data are inserted physical memory, avoid data from user's space to the copy of kernel spacing, avoid the user's space of CPU and the contextual processing of kernel spacing simultaneously.The internal memory of write data is added in the working memory pond of data source.
Corresponding API is used to carry out data transmission after step 4, data stuffing are complete, data object system after receiving the data, from the available memory pool of data object system, obtain free memory, by data stored in, and the internal memory stored in data is put into the working memory pond of data object system.
User application in step 5, data object system uses corresponding api interface from the working memory pond of data object system, obtain the next data of transmission, gives back available memory pool after finishing using.After corresponding API usage data, discharge the internal memory used, give back available memory pool by this internal memory, delete in the working memory pond of data object system simultaneously.Accordingly, corresponding API exists in the working memory pond of data source systems and deletes in data source systems uses, and gives back available memory pool.
Adopt the inventive method achieve directly by the data copy of user application in data source systems in data object system, decrease memory copying number of times and system call number of times.The inventive method is adopted to do the transmission of PCI-E data, as shown in table 1 with the contrast effect of the existing conventional data transmission scheme in background technology.Test employing 1 DELL2950 server+1 piece of PCI-E accelerator card, successively carries out PC and transmit to the data of accelerator card in units of 2K/8K/16K, respectively to carry out after 5 tests the on average transfer rate obtained.
The contrast table of table 1 Zero-copy data transmission plan of the present invention and traditional scheme
As shown in table 1, compared with traditional scheme, adopt the transfer rate of the inventive method higher, improve system transfers data volume.
Claims (1)
1. a PCI-E zero-copy DMA data transmission method, is characterized in that, comprise the steps:
Step one, in data source systems and data object system, distribute separately the physical memory of N block size, use doubly linked list to set up available memory pool and working memory pond to the N block physical memory in data source systems and data object system respectively;
During the user application transmission data of step 2, data source systems, corresponding API is used to obtain one piece of idle internal memory from the available memory pool of data source systems;
The user application of step 3, data source systems directly by data stuffing in acquired internal memory;
After step 4, data stuffing are complete, use corresponding API to transfer data to data object system, and leave the working memory pond of data object system in;
The user application of step 5, data object system uses corresponding API from the working memory pond of data object system, obtain the next data of transmission, after data are finished using, the internal memory used in data source systems and data object system is returned to available memory pool.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410472223.8A CN104239249B (en) | 2014-09-16 | 2014-09-16 | PCI E zero-copy DMA data transfer methods |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410472223.8A CN104239249B (en) | 2014-09-16 | 2014-09-16 | PCI E zero-copy DMA data transfer methods |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104239249A true CN104239249A (en) | 2014-12-24 |
CN104239249B CN104239249B (en) | 2017-08-04 |
Family
ID=52227356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410472223.8A Active CN104239249B (en) | 2014-09-16 | 2014-09-16 | PCI E zero-copy DMA data transfer methods |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104239249B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731735A (en) * | 2015-03-24 | 2015-06-24 | 浪潮集团有限公司 | Method for achieving high-performance loopback device through reference counting |
CN104901844A (en) * | 2015-05-13 | 2015-09-09 | 国家计算机网络与信息安全管理中心 | High precision timestamp acquisition method based on PCIE, device and network card |
CN105450986A (en) * | 2015-11-12 | 2016-03-30 | 厦门雅迅网络股份有限公司 | Video processing method in Linux system |
CN107480080A (en) * | 2017-07-03 | 2017-12-15 | 香港红鸟科技股份有限公司 | A kind of Zero-copy data stream based on RDMA |
US10515027B2 (en) | 2017-10-25 | 2019-12-24 | Hewlett Packard Enterprise Development Lp | Storage device sharing through queue transfer |
CN116455612A (en) * | 2023-03-23 | 2023-07-18 | 京信数据科技有限公司 | Privacy calculation intermediate data stream zero-copy device and method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101135980A (en) * | 2006-08-29 | 2008-03-05 | 飞塔信息科技(北京)有限公司 | Device and method for realizing zero copy based on Linux operating system |
CN101150485A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A management method for network data transmission of zero copy buffer queue |
CN101150488A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A receiving method for zero copy network packet |
-
2014
- 2014-09-16 CN CN201410472223.8A patent/CN104239249B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101135980A (en) * | 2006-08-29 | 2008-03-05 | 飞塔信息科技(北京)有限公司 | Device and method for realizing zero copy based on Linux operating system |
CN101150485A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A management method for network data transmission of zero copy buffer queue |
CN101150488A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A receiving method for zero copy network packet |
Non-Patent Citations (1)
Title |
---|
可向民等: "零拷贝技术及其实现的研究", 《计算机工程与科学》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731735A (en) * | 2015-03-24 | 2015-06-24 | 浪潮集团有限公司 | Method for achieving high-performance loopback device through reference counting |
CN104901844A (en) * | 2015-05-13 | 2015-09-09 | 国家计算机网络与信息安全管理中心 | High precision timestamp acquisition method based on PCIE, device and network card |
CN105450986A (en) * | 2015-11-12 | 2016-03-30 | 厦门雅迅网络股份有限公司 | Video processing method in Linux system |
CN105450986B (en) * | 2015-11-12 | 2020-02-07 | 厦门雅迅网络股份有限公司 | Video processing method under Linux |
CN107480080A (en) * | 2017-07-03 | 2017-12-15 | 香港红鸟科技股份有限公司 | A kind of Zero-copy data stream based on RDMA |
CN107480080B (en) * | 2017-07-03 | 2021-03-23 | 深圳致星科技有限公司 | Zero-copy data stream based on RDMA |
US10515027B2 (en) | 2017-10-25 | 2019-12-24 | Hewlett Packard Enterprise Development Lp | Storage device sharing through queue transfer |
CN116455612A (en) * | 2023-03-23 | 2023-07-18 | 京信数据科技有限公司 | Privacy calculation intermediate data stream zero-copy device and method |
CN116455612B (en) * | 2023-03-23 | 2023-11-28 | 京信数据科技有限公司 | Privacy calculation intermediate data stream zero-copy device and method |
Also Published As
Publication number | Publication date |
---|---|
CN104239249B (en) | 2017-08-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104239249A (en) | PCI-E (peripheral component interconnect-express) zero-copy DMA (direct memory access) data transmission method | |
CN102467473B (en) | Method and device for transmitting data between user space and kernel | |
CN108959117B (en) | H2D write operation acceleration method and device, computer equipment and storage medium | |
CN104090795B (en) | Method, system and device for upgrading multi-core mobile terminal | |
CN102566958B (en) | Image segmentation processing device based on SGDMA (scatter gather direct memory access) | |
US10061709B2 (en) | Systems and methods for accessing memory | |
CN106874226B (en) | Serial port data receiving, sending and transmitting device and method based on STM32F4 chip | |
GB2577022A (en) | Processing a space release command in a computer system | |
CN105450986B (en) | Video processing method under Linux | |
CN104239248B (en) | PCI E multiple buffer DMA data transfer methods | |
US20190310964A1 (en) | Speculative read mechanism for distributed storage system | |
WO2015024491A3 (en) | Enhanced data transfer in multi-cpu systems | |
CN103838694B (en) | FPGA high-speed USB interface data reading method | |
US10996865B2 (en) | Application-specific memory scaling in multi-device systems | |
CN203827467U (en) | Heterogeneous computer system multi-channel video parallel decoding structure | |
CN105843631B (en) | A method of improving system firmware burn writing speed | |
CN107861888A (en) | FPGA card DDR method, system, device and readable storage medium storing program for executing | |
CN105825880B (en) | Access control method, device and circuit for DDR controller | |
CN107832006A (en) | More main frames share the multi-functional fdisk storage device of same expanding storage apparatus | |
CN110825326A (en) | Method and device for improving SSD random reading performance, computer equipment and storage medium | |
CN116382569A (en) | Data processing method, device, hard disk and medium | |
CN106155626B (en) | A kind of quickly and effectively Android Sparse format image download method | |
CN112463037B (en) | Metadata storage method, device, equipment and product | |
US10108340B2 (en) | Method and system for a common processing framework for memory device controllers | |
CN105786409B (en) | A kind of electronic equipment and resource share method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |