lkml.org 
[lkml]   [2005]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: zero-copy read() interface
Folkert van Heusden <folkert@vanheusden.com> wrote:
>
> > > What about a zero-copy read-interface?
> > > An ioctl (or something) which enables the kernel to do dma directly to
> > > the userspace. Of course this should be limited to the root-user or a
> > > user with special capabilities (rights) since if a drive screws up, data
> > > from a different sector (or so) might end up in the proces' memory. Of
> > > course copying a sector from kernel- to userspace can be done pretty
> > > fast but i.m.h.o. all possible speedimprovements should be made unless
> > > unclean.
> > Just use mmap(). Unlike your proposal, it cooperates with the page
> > cache.
>
> Doesn't that one also use copying? I've also heard that using mmap is
> expensive due to pagefaulting. I've found, for example, that copying a
> 1.3GB file using read/write instead of mmap & memcpy is seconds faster.
>

You can use remap_file_pages() to read all the pages into pagecache and
then instantiate all their pte's in a single syscall.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-21 11:08    [W:0.047 / U:0.576 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site