Re: Thread implementations...

Chris Wedgwood (chris@cybernet.co.nz)
Thu, 25 Jun 1998 16:20:56 +1200


On Wed, Jun 24, 1998 at 11:50:11AM +0200, Martin Mares wrote:

> What about adding a syscall to _copy_ data from one file descriptor
> to another one, supporting not only sockets, but also plain files.
> Advantages:
>
> * File blocks can be copied without passing them to/from user
> space.
>
> * With some support in file systems, we can convert block-aligned
> copies directly to buffer cache operations, potentially using
> SCSI block copy operations).
>
> * We can also implement socket-to-file, file-to-pipe and several
> other interesting cases without introducing YAS (Yet Another
> Syscall).

Its possible.

Personally, I'd like to see how far we can get by tweaking the existing
frame work before adding more non standard APIs.

If the buffer cache and mm and reworked to support multiple referneces and
COW semantics we should be able to do something like:

ofd = open(big_file,...)
dfd = open(dest_file,...)
base = mmap(...,ofd,...)
write(fdf,base,length)

And have this work and near hardware IO speed, eliminating the costly buffer
cache copy to user space and so forth for DMA devices (which pretty much
everything that counts is these days).

Also, doing this means we could optimise NFS and socket performance up the
wazoo...

All this assume though, that we can make mmap+write as fast as read+write,
which I'm hopeful can be done.

-Chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu