Skip to contentSkip to conversation

Zero Copy IO

DISCUSSION Alex Q Chen 3 participants 3 messages Apr 8, 2001 – Apr 9, 2001

lore
Share & tools
lore
#0 lore raw

I am trying to find a way to pin down user space memory from kernel, so that these user space buffer can be used for direct IO transfer or otherwise known as "zero copying IO". Searching through the Internet and reading comments on various news groups, it would appear that most developers including Linus himself doesn't believe in the benefit of "zero copying IO". Most of the discussion however was based on network card drivers. For certain other drivers such as SCSI Tape driver, which need to handle great deal of data transfer, it would seemed still be more advantageous to enable zero copy IO than copy_from_user() and copy_to_user () all the data. Other OS such as AIX and OS2 have kernel functions that can be used to accomplish such a task. Has any ground work been done in Linux 2.4 to enable "zero copying IO"?

Thanks in advance for any suggestions or comments

Sincerely,
Alex Chen

IBM SSD Device Driver Development
Office: 9000 S. Rita Rd 9032/2262
Email: [email protected]
Phone: (external) 520-799-5212 (Tie Line) (321)-5212

#1 lore raw
Quoted 4 lines · Alex Q Chen

I am trying to find a way to pin down user space memory from kernel, so that these user space buffer can be used for direct IO transfer or otherwise known as "zero copying IO". Searching through the Internet and reading comments on various news groups, it would appear that most

Quoted 8 lines

developers including Linus himself doesn't believe in the benefit of "zero copying IO". Most of the discussion however was based on network card drivers. For certain other drivers such as SCSI Tape driver, which need to handle great deal of data transfer, it would seemed still be more advantageous to enable zero copy IO than copy_from_user() and copy_to_user () all the data. Other OS such as AIX and OS2 have kernel functions that can be used to accomplish such a task. Has any ground work been done in Linux 2.4 to enable "zero copying IO"?

Yes, e.g. the raw io device does it using kiovecs. See drivers/char/raw.c,fs/iobuf.c et.al. 2.4+zerocopy networking also has a different implementation.
The raw.c implementation is not very efficient at the moment though, mostly because of limitations in the block device layer (but that should be no problem for a direct tape driver)
This work is also in the 2.2 kernels of most distributions.

-Andi

#2 lore raw
In reply to Alex Q Chen
Quoted 4 lines

advantageous to enable zero copy IO than copy_from_user() and copy_to_user () all the data. Other OS such as AIX and OS2 have kernel functions that can be used to accomplish such a task. Has any ground work been done in Linux 2.4 to enable "zero copying IO"?

kiovecs support this. Note that the current kiovec has problems when it comes to certain kinds of latency critical use and the 2.5 kernel meeting hashed out some big changes here. But for 2.4 the kiovecs are there