next up previous
Next: Passing Physical Addresses Up: User-Level DMA - Early Previous: The Problem

Kernel-Level Initiation of DMA

The traditional solution to the above problem is that the user application wanting to make a data transfer calls the operating system with the necessary arguments: vsource, vdestination and size. The operating system runs (with interrupts disabled), checks size, translates the virtual addresses vsource and vdestination to their corresponding physical addresses psource and pdestination, writes the arguments psource, pdestination, and size to the DMA engine registers, and starts a DMA transfer. The pseudo-code necessary to start a DMA operation from inside the operating system is shown in figure 1.

 

  figure51


Figure 1: Typical Initiation of kernel-level DMA

Note, that all mentioned instructions are executed uninterrupted (in kernel mode), and thus the atomicity of DMA initiation is guaranteed. Translation from virtual addresses to physical addresses is being done inside the operating system in software, by the virtual_to_physical function. During address translation, the access rights of the user are checked to make sure that the user process who requested the DMA operation has read access to the page that contains address vsource, and write access to the page that contains address vdestination.

Although the overhead of the operating system involvement in starting a DMA operation has been considered low (especially for DMA operations that transfer data between main memory and disk), this is not the case for network transfers anymore. It is well known that Operating Systems do not get faster as fast as hardware does [11, 12]. Operating System overhead (measured in processor cycles) continues to increase with time. Large sets of registers that need to be saved/restored, lack of data locality, and slow I/O buses are some of the reasons why operating systems do not get faster as fast as processors do. Recent performance results suggest that the overhead of an empty system call of commercial UNIX-like operating systems ranges between 1,000 and 5,000 processor cycles [10]. At the same time, we witness a impressive improvement in network throughput. ATM networks that provide 155 Mbps are common today, and will soon be upgraded to 622 Mbps. Gigabit LANs have already started to appear in the market. Thus, the operating system overhead keeps getting an ever-increasing percentage of the DMA transfer time, while the time for the data transfer per se, continues to decrease. Soon, the operating system overhead will dominate the DMA transfer, making the necessity of user-level DMA more important than ever.


next up previous
Next: Passing Physical Addresses Up: User-Level DMA - Early Previous: The Problem

Evangelos Markatos
Fri Nov 8 12:27:33 EET 1996